"...We have located the enemy fleet under the command of Admiral Kompüter,
+ but do not yet have visual contact. We suggest the best course of action is to fire
+ at random into their vicinity and listen for the impact of the shells...
+
...Our intelligence sources indicate the composition of the enemy fleet is the same
+ as our own, and has likewise been forced to resort to the same tactics as ourselves. In accordance with
+ the rules of war, fire will be exchanged one shell at a time and vessels lost will be announced
+ immediately...
+
...As per your orders you have been placed directly in command of the fleet's guns. Select the target
+ location by clicking in the left-hand grid above. The right hand grid shows the status of our own fleet.
+ Information as to the remaining strength of the enemy will be relayed directly to your status bar...
+
...We believe this battle will not be over until one or other fleet is sunk in it's entirety. Our
+ gunners
+ await your commands. We're counting on you, Sir..."
diff --git a/Misc/ChromeExtensionSamples/05 Options/script.js b/Misc/ChromeExtensionSamples/05 Options/script.js
new file mode 100644
index 0000000..90b1e09
--- /dev/null
+++ b/Misc/ChromeExtensionSamples/05 Options/script.js
@@ -0,0 +1,10 @@
+window.addEventListener('load', function load(event) {
+ chrome.storage.local.get('name', function(result) {
+ if (result != undefined && result.name != undefined) {
+ document.getElementById('name').value = result.name;
+ }
+ });
+ document.getElementById('save').onclick = function() {
+ chrome.storage.local.set({'name': document.getElementById('name').value});
+ };
+});
diff --git a/Misc/ChromeExtensionSamples/README.md b/Misc/ChromeExtensionSamples/README.md
new file mode 100644
index 0000000..48f68cf
--- /dev/null
+++ b/Misc/ChromeExtensionSamples/README.md
@@ -0,0 +1,9 @@
+# Simple Chrome Extension Samples
+
+We all have our favorite web browser with our favorite extensions loaded, but have you ever considered writing your own? You've probably had at least one idea for something that it'd be nice to have, but there's nothing out there that quite does what you're looking for.
+
+As technology becomes more and more a part of our everyday lives, it's useful to understand how to manipulate it to suit our individual needs. These days, knowing at least a little coding is like learning word processing or writing a basic html page was 15 years ago. It's becoming a basic computer skill.
+
+In the past few months I've created a couple extensions to suit my own needs - unpolished but functional - and threw them in the Chrome Web Store just in case someone out there found them useful.
+
+[Here's what I've learned](https://grantwinney.com/making-your-first-chrome-extension/).
diff --git a/GetKnownFolders/CPlusPlus/CPlusPlus.sln b/Misc/GetKnownFolders/CPlusPlus/CPlusPlus.sln
similarity index 100%
rename from GetKnownFolders/CPlusPlus/CPlusPlus.sln
rename to Misc/GetKnownFolders/CPlusPlus/CPlusPlus.sln
diff --git a/GetKnownFolders/CPlusPlus/ConsoleApplication1/ConsoleApplication1.cpp b/Misc/GetKnownFolders/CPlusPlus/ConsoleApplication1/ConsoleApplication1.cpp
similarity index 100%
rename from GetKnownFolders/CPlusPlus/ConsoleApplication1/ConsoleApplication1.cpp
rename to Misc/GetKnownFolders/CPlusPlus/ConsoleApplication1/ConsoleApplication1.cpp
diff --git a/GetKnownFolders/CPlusPlus/ConsoleApplication1/ConsoleApplication1.vcxproj b/Misc/GetKnownFolders/CPlusPlus/ConsoleApplication1/ConsoleApplication1.vcxproj
similarity index 100%
rename from GetKnownFolders/CPlusPlus/ConsoleApplication1/ConsoleApplication1.vcxproj
rename to Misc/GetKnownFolders/CPlusPlus/ConsoleApplication1/ConsoleApplication1.vcxproj
diff --git a/GetKnownFolders/CPlusPlus/ConsoleApplication1/ConsoleApplication1.vcxproj.filters b/Misc/GetKnownFolders/CPlusPlus/ConsoleApplication1/ConsoleApplication1.vcxproj.filters
similarity index 100%
rename from GetKnownFolders/CPlusPlus/ConsoleApplication1/ConsoleApplication1.vcxproj.filters
rename to Misc/GetKnownFolders/CPlusPlus/ConsoleApplication1/ConsoleApplication1.vcxproj.filters
diff --git a/GetKnownFolders/CSharp/CSharp.sln b/Misc/GetKnownFolders/CSharp/CSharp.sln
similarity index 100%
rename from GetKnownFolders/CSharp/CSharp.sln
rename to Misc/GetKnownFolders/CSharp/CSharp.sln
diff --git a/GetKnownFolders/CSharp/GetKnownFolder/GetKnownFolder.csproj b/Misc/GetKnownFolders/CSharp/GetKnownFolder/GetKnownFolder.csproj
similarity index 100%
rename from GetKnownFolders/CSharp/GetKnownFolder/GetKnownFolder.csproj
rename to Misc/GetKnownFolders/CSharp/GetKnownFolder/GetKnownFolder.csproj
diff --git a/GetKnownFolders/CSharp/GetKnownFolder/Program.cs b/Misc/GetKnownFolders/CSharp/GetKnownFolder/Program.cs
similarity index 100%
rename from GetKnownFolders/CSharp/GetKnownFolder/Program.cs
rename to Misc/GetKnownFolders/CSharp/GetKnownFolder/Program.cs
diff --git a/GetKnownFolders/Python/GetKnownFolders.py b/Misc/GetKnownFolders/Python/GetKnownFolders.py
similarity index 100%
rename from GetKnownFolders/Python/GetKnownFolders.py
rename to Misc/GetKnownFolders/Python/GetKnownFolders.py
diff --git a/Misc/TweetRandomFeedItem/README.md b/Misc/TweetRandomFeedItem/README.md
new file mode 100644
index 0000000..a205160
--- /dev/null
+++ b/Misc/TweetRandomFeedItem/README.md
@@ -0,0 +1,40 @@
+# Tweet a Random RSS Feed Item
+
+***Using [AWS Lambda](https://aws.amazon.com/lambda/) and [Tweetinvi](https://github.com/linvi/tweetinvi)***
+
+This project is a slight modification of [my last one](https://github.com/grantwinney/BlogCodeSamples/tree/master/Misc/TweetRandomPostFromAGhostBlog), replacing reading posts via the Ghost API to a more general parsing of RSS feeds. I wanted to create something that would work for *any* blog... or anything else that generates an RSS feed.
+
+## Usage
+
+This is a C# console you can run from AWS Lambda. Schedule it to run as often as you like using Lambda's [cron scheduling](https://docs.aws.amazon.com/lambda/latest/dg/tutorial-scheduled-events-schedule-expressions.html) capabilities.
+
+If you'd like to read more about it, [I wrote a blog post about it too](https://grantwinney.com/using-aws-lambda-to-tweet-random-posts-from-an-rss-feed/).
+
+### Getting the code
+
+1. Clone this repo: `git clone https://github.com/grantwinney/BlogCodeSamples.git`
+2. Find the project under "Misc/TweetRandomFeedItem" and build it, either in Visual Studio or at the command line.
+3. Find the `bin` directory on disk, and drill down until you get to the assemblies (dll files). Most likely: `bin/Debug/netcoreapp2.0`
+4. Zip up the contents of the inner-most directory, but not the directory itself. _(e.g. just select all the files_ inside _`netcoreapp2.0`.)_
+
+### Setting up AWS Lambda
+
+Now you need to create a new AWS Lambda job. [Check this out](https://victoria.dev/archive/running-a-free-twitter-bot-on-aws-lambda/#setting-up-aws-lambda) for a brief intro to setting up a job.
+
+1. Create a new function and choose `C# (.NET Core 2.0)` for the runtime. _(this may change as new versions are released)_
+2. The name of the function, and the role it makes you create, don't matter.
+3. Upload the zip file you created above.
+4. Set the handler as `TweetRandomFeedItem::TweetRandomFeedItem.Program::Main`
+5. Under "Basic settings", decrease the memory to 128MB and increase the timeout to a minute. For me, it generally takes about 15-20 seconds to run, and uses less than 100MB of memory. You may have to play with the settings a bit.
+6. Set the following environment variables:
+
+#### Environment Variables
+
+I use quite a few environment variables, so credentials and other settings can easily be changed between runs, without having to recompile the code and upload it again.
+
+| Field | Required | Description |
+| ------------- |:-------------:| -----|
+| `RSS_URI` | Yes | The RSS feed to read in, like: `https://grantwinney.com/rss/` |
+| `RSS_ITEM_RETRIEVAL_LIMIT` | No | Specify the number of posts you want to retrieve.
If you omit this, or leave the value empty, the app will read the entire RSS feed. |
+| `TWITTER_CONSUMER_KEY` `TWITTER_CONSUMER_SECRET` `TWITTER_USER_ACCESS_TOKEN` `TWITTER_USER_ACCESS_TOKEN_SECRET` | Yes | These values all come from your Twitter account. You need to create a new app to get these values, which allows you to post tweets. |
+| `TWITTER_MAX_TAG_COUNT` | No | Although tag spamming is somewhat prevalent on Facebook, and even more-so on Instagram, I don't see a lot of it on Twitter. If you tend to use a lot of tags for posts on your blog, then you can limit how many of those transfer to your tweet.
If you omit this, or leave the value empty, the app will use the first 3 tags. |
diff --git a/Misc/TweetRandomFeedItem/TweetRandomFeedItem.sln b/Misc/TweetRandomFeedItem/TweetRandomFeedItem.sln
new file mode 100644
index 0000000..365b549
--- /dev/null
+++ b/Misc/TweetRandomFeedItem/TweetRandomFeedItem.sln
@@ -0,0 +1,17 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 2012
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TweetRandomFeedItem", "TweetRandomFeedItem\TweetRandomFeedItem.csproj", "{A65ED552-1655-436F-B2F5-C41F35DE00F3}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {A65ED552-1655-436F-B2F5-C41F35DE00F3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {A65ED552-1655-436F-B2F5-C41F35DE00F3}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {A65ED552-1655-436F-B2F5-C41F35DE00F3}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {A65ED552-1655-436F-B2F5-C41F35DE00F3}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+EndGlobal
diff --git a/Misc/TweetRandomFeedItem/TweetRandomFeedItem/Helper.cs b/Misc/TweetRandomFeedItem/TweetRandomFeedItem/Helper.cs
new file mode 100644
index 0000000..afde505
--- /dev/null
+++ b/Misc/TweetRandomFeedItem/TweetRandomFeedItem/Helper.cs
@@ -0,0 +1,24 @@
+using System;
+namespace TweetRandomFeedItem
+{
+ public class Helper
+ {
+ public static T GetEnv(string environmentVariable)
+ {
+ try
+ {
+ return (T)Convert.ChangeType(Environment.GetEnvironmentVariable(environmentVariable), typeof(T));
+ }
+ catch (ArgumentNullException)
+ {
+ Console.WriteLine($"The environment variable {environmentVariable} is required and missing.");
+ throw;
+ }
+ }
+
+ public static T GetEnv(string environmentVariable, string defaultValue)
+ {
+ return (T)Convert.ChangeType(Environment.GetEnvironmentVariable(environmentVariable) ?? defaultValue, typeof(T));
+ }
+ }
+}
diff --git a/Misc/TweetRandomFeedItem/TweetRandomFeedItem/Program.cs b/Misc/TweetRandomFeedItem/TweetRandomFeedItem/Program.cs
new file mode 100644
index 0000000..cf14f3a
--- /dev/null
+++ b/Misc/TweetRandomFeedItem/TweetRandomFeedItem/Program.cs
@@ -0,0 +1,86 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text.RegularExpressions;
+using System.Threading.Tasks;
+using System.Xml;
+using Microsoft.SyndicationFeed;
+using Microsoft.SyndicationFeed.Rss;
+using Tweetinvi;
+
+namespace TweetRandomFeedItem
+{
+ class Program
+ {
+ const string DEFAULT_MAX_TAG_COUNT = "3";
+ const int TWITTER_URL_SIZE = 23;
+ const int MAX_TWEET_LENGTH = 280;
+
+ static Random random = new Random();
+
+ public static async void Main()
+ {
+ var message = CreateMessageFromRandomFeedItem();
+
+ await SendTweet(message);
+
+ Console.WriteLine($"Tweeted message:\r\n\r\n{message}");
+ }
+
+ static string CreateMessageFromRandomFeedItem()
+ {
+ var ghostUri = Helper.GetEnv("RSS_URI");
+ var maxTagCount = Helper.GetEnv("TWITTER_MAX_TAG_COUNT", DEFAULT_MAX_TAG_COUNT);
+ var maxItemsToRead = Helper.GetEnv("RSS_ITEM_RETRIEVAL_LIMIT", Int32.MaxValue.ToString());
+
+ var pattern = new Regex("[- ]");
+ var entries = new List();
+
+ using (var xmlReader = XmlReader.Create(ghostUri))
+ {
+ var feedReader = new RssFeedReader(xmlReader);
+
+ var itemsRead = 0;
+ while (feedReader.Read().Result && itemsRead < maxItemsToRead)
+ {
+ if (feedReader.ElementType == SyndicationElementType.Item)
+ {
+ entries.Add(feedReader.ReadItem().Result);
+ itemsRead++;
+ }
+ }
+ }
+
+ var selectedEntry = entries[random.Next(0, entries.Count - 1)];
+
+ var remainingSpaceForTags = MAX_TWEET_LENGTH - (selectedEntry.Title.Length + 1 + TWITTER_URL_SIZE);
+
+ var tags = selectedEntry.Categories.Take(maxTagCount).Select(x => $"#{pattern.Replace(x.Name, "_").Replace("#", "sharp").Replace(".", "dot")}");
+
+ var tagsFlat = "";
+ foreach (var t in tags)
+ {
+ if ($"{tagsFlat} {t}".Length > remainingSpaceForTags)
+ break;
+
+ tagsFlat += $" {t}";
+ }
+
+ return $"{selectedEntry.Title}{tagsFlat}\r\n{selectedEntry.Links.ToList()[0].Uri}";
+ }
+
+ static async Task SendTweet(string message)
+ {
+ var consumerKey = Helper.GetEnv("TWITTER_CONSUMER_KEY");
+ var consumerSecret = Helper.GetEnv("TWITTER_CONSUMER_SECRET");
+ var userAccessToken = Helper.GetEnv("TWITTER_USER_ACCESS_TOKEN");
+ var userAccessTokenSecret = Helper.GetEnv("TWITTER_USER_ACCESS_TOKEN_SECRET");
+
+ var userClient = new TwitterClient(consumerKey, consumerSecret, userAccessToken, userAccessTokenSecret);
+
+ await userClient.Tweets.PublishTweetAsync(message);
+
+ Console.WriteLine($"Tweeted message:\r\n{message}\r\n");
+ }
+ }
+}
diff --git a/Misc/TweetRandomFeedItem/TweetRandomFeedItem/TweetRandomFeedItem.csproj b/Misc/TweetRandomFeedItem/TweetRandomFeedItem/TweetRandomFeedItem.csproj
new file mode 100644
index 0000000..901ac4b
--- /dev/null
+++ b/Misc/TweetRandomFeedItem/TweetRandomFeedItem/TweetRandomFeedItem.csproj
@@ -0,0 +1,20 @@
+
+
+
+ Exe
+ netcoreapp2.0
+
+
+
+ true
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Misc/TweetRandomFeedItem/TweetRandomFeedItem/TweetRandomFeedItem.sln b/Misc/TweetRandomFeedItem/TweetRandomFeedItem/TweetRandomFeedItem.sln
new file mode 100644
index 0000000..92f7f4e
--- /dev/null
+++ b/Misc/TweetRandomFeedItem/TweetRandomFeedItem/TweetRandomFeedItem.sln
@@ -0,0 +1,17 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 2017
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TweetRandomFeedItem", "TweetRandomFeedItem.csproj", "{E5CCB899-06D3-4062-98B4-9BAA87B08322}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {E5CCB899-06D3-4062-98B4-9BAA87B08322}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {E5CCB899-06D3-4062-98B4-9BAA87B08322}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {E5CCB899-06D3-4062-98B4-9BAA87B08322}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {E5CCB899-06D3-4062-98B4-9BAA87B08322}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+EndGlobal
diff --git a/Misc/TweetRandomPostFromAGhostBlog/README.md b/Misc/TweetRandomPostFromAGhostBlog/README.md
new file mode 100644
index 0000000..49403e7
--- /dev/null
+++ b/Misc/TweetRandomPostFromAGhostBlog/README.md
@@ -0,0 +1,5 @@
+# Tweet a Random Post from a Ghost Blog
+
+Instead of repeating everything here, you can read all the details of how to use this and the libraries it depends on here:
+
+[Using AWS Lambda to tweet random posts from a Ghost blog](https://grantwinney.com/using-aws-lambda-and-tweetinvi-to-tweet-a-random-ghost-blog-post/)
diff --git a/Misc/TweetRandomPostFromAGhostBlog/TweetRandomFeedItem.sln b/Misc/TweetRandomPostFromAGhostBlog/TweetRandomFeedItem.sln
new file mode 100644
index 0000000..88f781d
--- /dev/null
+++ b/Misc/TweetRandomPostFromAGhostBlog/TweetRandomFeedItem.sln
@@ -0,0 +1,30 @@
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.30517.126
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TweetRandomFeedItem", "TweetRandomFeedItem\TweetRandomFeedItem.csproj", "{A65ED552-1655-436F-B2F5-C41F35DE00F3}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TweetRandomFeedItemTests", "TweetRandomFeedItemTests\TweetRandomFeedItemTests.csproj", "{E74EA8AD-34AD-488B-8D56-9A5B3D7DA940}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {A65ED552-1655-436F-B2F5-C41F35DE00F3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {A65ED552-1655-436F-B2F5-C41F35DE00F3}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {A65ED552-1655-436F-B2F5-C41F35DE00F3}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {A65ED552-1655-436F-B2F5-C41F35DE00F3}.Release|Any CPU.Build.0 = Release|Any CPU
+ {E74EA8AD-34AD-488B-8D56-9A5B3D7DA940}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {E74EA8AD-34AD-488B-8D56-9A5B3D7DA940}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {E74EA8AD-34AD-488B-8D56-9A5B3D7DA940}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {E74EA8AD-34AD-488B-8D56-9A5B3D7DA940}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {55609BE2-7144-430D-A555-6E134855C7F0}
+ EndGlobalSection
+EndGlobal
diff --git a/Misc/TweetRandomPostFromAGhostBlog/TweetRandomFeedItem/Helper.cs b/Misc/TweetRandomPostFromAGhostBlog/TweetRandomFeedItem/Helper.cs
new file mode 100644
index 0000000..4075300
--- /dev/null
+++ b/Misc/TweetRandomPostFromAGhostBlog/TweetRandomFeedItem/Helper.cs
@@ -0,0 +1,57 @@
+using System;
+using System.Text.RegularExpressions;
+
+namespace TweetRandomFeedItem
+{
+ public class Helper
+ {
+ static readonly Regex invalidChars = new("[- ]");
+
+ public static string SanitizeTagName(string tag)
+ {
+ return $"#{invalidChars.Replace(tag, "").Replace("#", "sharp").Replace(".", "dot")}";
+ }
+
+ public static T GetEnv(string environmentVariable)
+ {
+ try
+ {
+ return ConvertVariableType(environmentVariable, Environment.GetEnvironmentVariable(environmentVariable));
+ }
+ catch (ArgumentNullException)
+ {
+ Console.WriteLine($"The environment variable {environmentVariable} is missing.");
+ throw;
+ }
+ }
+
+ public static T GetEnv(string environmentVariable, string defaultValue)
+ {
+ try
+ {
+ return ConvertVariableType(environmentVariable, Environment.GetEnvironmentVariable(environmentVariable), defaultValue);
+ }
+ catch (ArgumentNullException)
+ {
+ Console.WriteLine($"The environment variable {environmentVariable} is missing.");
+ throw;
+ }
+ }
+
+ public static T ConvertVariableType(string variableKey, string variableValue, string defaultValue = null)
+ {
+ if (string.IsNullOrEmpty(variableValue))
+ {
+ if (defaultValue != null)
+ {
+ Console.WriteLine($"The environment variable {variableKey} returned a null value. Using default value of '{defaultValue}' instead.");
+ return (T)Convert.ChangeType(defaultValue, typeof(T));
+ }
+ else
+ Console.WriteLine($"The environment variable {variableKey} returned a null value.");
+ }
+
+ return (T)Convert.ChangeType(variableValue, typeof(T));
+ }
+ }
+}
diff --git a/Misc/TweetRandomPostFromAGhostBlog/TweetRandomFeedItem/Program.cs b/Misc/TweetRandomPostFromAGhostBlog/TweetRandomFeedItem/Program.cs
new file mode 100644
index 0000000..efd48b8
--- /dev/null
+++ b/Misc/TweetRandomPostFromAGhostBlog/TweetRandomFeedItem/Program.cs
@@ -0,0 +1,164 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Net.Http;
+using System.Text;
+using System.Threading.Tasks;
+using GhostSharp;
+using GhostSharp.Entities;
+using GhostSharp.Enums;
+using GhostSharp.QueryParams;
+using Newtonsoft.Json;
+using Tweetinvi;
+using Tweetinvi.Core.Web;
+using Tweetinvi.Models;
+
+namespace TweetRandomFeedItem
+{
+ class Program
+ {
+ private const int TWITTER_URL_SIZE = 23;
+ private const int MAX_TWEET_LENGTH = 280;
+
+ private static readonly string API_URL = Helper.GetEnv("API_URL");
+ private static readonly string ADMIN_API_KEY = Helper.GetEnv("ADMIN_API_KEY");
+ private static readonly string TWITTER_CONSUMER_KEY = Helper.GetEnv("TWITTER_CONSUMER_KEY");
+ private static readonly string TWITTER_CONSUMER_SECRET = Helper.GetEnv("TWITTER_CONSUMER_SECRET");
+ private static readonly string TWITTER_USER_ACCESS_TOKEN = Helper.GetEnv("TWITTER_USER_ACCESS_TOKEN");
+ private static readonly string TWITTER_USER_ACCESS_TOKEN_SECRET = Helper.GetEnv("TWITTER_USER_ACCESS_TOKEN_SECRET");
+ private static readonly string[] TAGS_TO_TWEET = Helper.GetEnv("TAGS_TO_TWEET", "").Split(',');
+ private static readonly string[] TAGS_TO_REMOVE = Helper.GetEnv("TAGS_TO_REMOVE", "").Split(',');
+ private static readonly int POST_RETRIEVAL_LIMIT = Helper.GetEnv("POST_RETRIEVAL_LIMIT", "9999999");
+ private static readonly int TWITTER_MAX_TAG_COUNT = Helper.GetEnv("TWITTER_MAX_TAG_COUNT", "3");
+ private static readonly bool FACTOR_IN_AGE_OF_POST = Helper.GetEnv("FACTOR_IN_AGE_OF_POST", "false");
+
+ static readonly Random rnd = new Random();
+ static readonly GhostAdminAPI api = new GhostAdminAPI(API_URL, ADMIN_API_KEY);
+
+ public static async Task Main()
+ {
+ var allPosts = api.GetPosts(new PostQueryParams
+ {
+ Limit = POST_RETRIEVAL_LIMIT,
+ Fields = (FACTOR_IN_AGE_OF_POST ? PostFields.Id | PostFields.PublishedAt : PostFields.Id) | PostFields.Status,
+ }).Posts.Where(p => p.Status == "published").ToList();
+
+ if (!allPosts.Any())
+ {
+ Console.WriteLine("No posts! Nothing to tweet...");
+ return;
+ }
+
+ await SendTweet(CreateMessage(PickRandomPost(allPosts)));
+ }
+
+ static Post PickRandomPost(List posts)
+ {
+ var selectedIds = new HashSet();
+
+ while (true)
+ {
+ string randomPostId = "";
+ do
+ {
+ randomPostId = FACTOR_IN_AGE_OF_POST
+ ? GetRandomPostIdWeightedOnAge(posts)
+ : posts[rnd.Next(0, posts.Count())].Id;
+ }
+ while (selectedIds.Contains(randomPostId));
+
+ selectedIds.Add(randomPostId);
+
+ var randomPost = api.GetPostById(randomPostId);
+
+ if (!TAGS_TO_TWEET.Any() || randomPost.Tags.Select(tag => tag.Slug).Intersect(TAGS_TO_TWEET).Any())
+ return randomPost;
+ }
+ }
+
+ static string GetRandomPostIdWeightedOnAge(List posts)
+ {
+ var earliestPublishDate = posts.Last().PublishedAt;
+
+ var postsCount = posts.Count();
+ var postIdsAndPubWeights = posts.Select((p, i) => Tuple.Create(posts[i].Id, ((posts[i].PublishedAt ?? DateTime.MinValue) - earliestPublishDate).Value.Days * (postsCount - i)));
+ var totalPubWeights = postIdsAndPubWeights.Sum(p => p.Item2);
+ var randomPubWeight = rnd.Next(0, totalPubWeights);
+
+ foreach (var p in postIdsAndPubWeights)
+ {
+ if (randomPubWeight <= p.Item2)
+ return p.Item1;
+
+ randomPubWeight -= p.Item2;
+ }
+
+ return null; // req to compile, but won't happen unless there are no posts
+ }
+
+ static string CreateMessage(Post post)
+ {
+ var captionSources = new List { post.TwitterDescription, post.MetaDescription, post.Title };
+
+ var caption = captionSources.First(cs => !string.IsNullOrWhiteSpace(cs));
+
+ var remainingSpaceForTags = MAX_TWEET_LENGTH - (caption.Length + 1 + TWITTER_URL_SIZE);
+
+ var tags = post.Tags.Where(x => !TAGS_TO_REMOVE.Contains(x.Slug))
+ .Take(TWITTER_MAX_TAG_COUNT)
+ .Select(t => Helper.SanitizeTagName(t.Name));
+
+ var tagsFlat = "";
+ foreach (var t in tags)
+ {
+ if ($"{tagsFlat} {t}".Length > remainingSpaceForTags)
+ break;
+
+ tagsFlat += $" {t}";
+ }
+
+ return $"{caption}{tagsFlat}\r\n{post.Url}";
+ }
+
+ static async Task SendTweet(string message)
+ {
+ var client = new TwitterClient(TWITTER_CONSUMER_KEY, TWITTER_CONSUMER_SECRET, TWITTER_USER_ACCESS_TOKEN, TWITTER_USER_ACCESS_TOKEN_SECRET);
+
+ //await userClient.Tweets.PublishTweetAsync(message);
+
+ // The TweetInvi library seems to be abandoned and PublishTweetAsync isn't working correctly,
+ // but someone posted a workaround: https://github.com/linvi/tweetinvi/issues/1147#issuecomment-1173174302
+ var result = await client.Execute.AdvanceRequestAsync(
+ (ITwitterRequest request) =>
+ {
+ var jsonBody = client.Json.Serialize(new TweetV2PostRequest { Text = message });
+
+ var content = new StringContent(jsonBody, Encoding.UTF8, "application/json");
+
+ request.Query.Url = "https://api.twitter.com/2/tweets";
+ request.Query.HttpMethod = Tweetinvi.Models.HttpMethod.POST;
+ request.Query.HttpContent = content;
+ }
+ );
+
+ if (result.Response.IsSuccessStatusCode)
+ Console.WriteLine($"Tweeted message:\r\n{message}\r\n");
+ else
+ Console.WriteLine($"Error posting tweet: {result.Content}\r\n\r\nOriginal tweet: {message}");
+ }
+ }
+
+ ///
+ /// There are a lot more fields according to:
+ /// https://developer.twitter.com/en/docs/twitter-api/tweets/manage-tweets/api-reference/post-tweets
+ /// but these are the ones we care about for our use case.
+ ///
+ public class TweetV2PostRequest
+ {
+ ///
+ /// The text of the tweet to post.
+ ///
+ [JsonProperty("text")]
+ public string Text { get; set; } = string.Empty;
+ }
+}
diff --git a/Misc/TweetRandomPostFromAGhostBlog/TweetRandomFeedItem/TweetRandomFeedItem.csproj b/Misc/TweetRandomPostFromAGhostBlog/TweetRandomFeedItem/TweetRandomFeedItem.csproj
new file mode 100644
index 0000000..fdabc1e
--- /dev/null
+++ b/Misc/TweetRandomPostFromAGhostBlog/TweetRandomFeedItem/TweetRandomFeedItem.csproj
@@ -0,0 +1,17 @@
+
+
+
+ Exe
+ net6.0
+
+
+
+ true
+
+
+
+
+
+
+
+
diff --git a/Misc/TweetRandomPostFromAGhostBlog/TweetRandomFeedItem/TweetRandomFeedItem.sln b/Misc/TweetRandomPostFromAGhostBlog/TweetRandomFeedItem/TweetRandomFeedItem.sln
new file mode 100644
index 0000000..92f7f4e
--- /dev/null
+++ b/Misc/TweetRandomPostFromAGhostBlog/TweetRandomFeedItem/TweetRandomFeedItem.sln
@@ -0,0 +1,17 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 2017
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TweetRandomFeedItem", "TweetRandomFeedItem.csproj", "{E5CCB899-06D3-4062-98B4-9BAA87B08322}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {E5CCB899-06D3-4062-98B4-9BAA87B08322}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {E5CCB899-06D3-4062-98B4-9BAA87B08322}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {E5CCB899-06D3-4062-98B4-9BAA87B08322}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {E5CCB899-06D3-4062-98B4-9BAA87B08322}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+EndGlobal
diff --git a/Misc/TweetRandomPostFromAGhostBlog/TweetRandomFeedItemTests/HelperTests.cs b/Misc/TweetRandomPostFromAGhostBlog/TweetRandomFeedItemTests/HelperTests.cs
new file mode 100644
index 0000000..7ca5f8a
--- /dev/null
+++ b/Misc/TweetRandomPostFromAGhostBlog/TweetRandomFeedItemTests/HelperTests.cs
@@ -0,0 +1,44 @@
+using NUnit.Framework;
+using TweetRandomFeedItem;
+
+namespace TweetRandomFeedItemTests
+{
+ public class Tests
+ {
+ [Test]
+ [TestCase("c#", "#csharp")]
+ [TestCase(".net", "#dotnet")]
+ [TestCase("testing-123", "#testing123")]
+ [TestCase("testing 123 456", "#testing123456")]
+ [TestCase("1-2 3", "#123")]
+ public void SanitizeTagName_ReplacesInvalidCharacters(string input, string expectedOutput)
+ {
+ Assert.AreEqual(expectedOutput, Helper.SanitizeTagName(input));
+ }
+
+ [Test]
+ [TestCase("phone#", "#phonesharp")]
+ [TestCase("this.that", "#thisdotthat")]
+ public void SanitizeTagName_MightHaveUnintendedEffects(string input, string expectedOutput)
+ {
+ Assert.AreEqual(expectedOutput, Helper.SanitizeTagName(input));
+ }
+
+ [Test]
+ [TestCase("programming")]
+ [TestCase("csharp_8")]
+ public void SanitizeTagName_LeavesValidTagsAlone(string tagName)
+ {
+ Assert.AreEqual($"#{tagName}", Helper.SanitizeTagName(tagName));
+ }
+
+ [Test]
+ [TestCase(null, "9999999", 9999999)]
+ [TestCase("", "9999999", 9999999)]
+ [TestCase("3", "9999999", 3)]
+ public void ConvertVariableType_ConvertsStringsToNumbers(string variableValue, string defaultValue, int expectedResult)
+ {
+ Assert.AreEqual(expectedResult, Helper.ConvertVariableType("n/a", variableValue, defaultValue));
+ }
+ }
+}
\ No newline at end of file
diff --git a/Misc/TweetRandomPostFromAGhostBlog/TweetRandomFeedItemTests/TweetRandomFeedItemTests.csproj b/Misc/TweetRandomPostFromAGhostBlog/TweetRandomFeedItemTests/TweetRandomFeedItemTests.csproj
new file mode 100644
index 0000000..c255cf7
--- /dev/null
+++ b/Misc/TweetRandomPostFromAGhostBlog/TweetRandomFeedItemTests/TweetRandomFeedItemTests.csproj
@@ -0,0 +1,19 @@
+
+
+
+ net6.0
+
+ false
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/WindowsXPVisualStudio/VB4.0/Form1.frm b/Misc/WindowsXPVisualStudio/VB4.0/Form1.frm
similarity index 100%
rename from WindowsXPVisualStudio/VB4.0/Form1.frm
rename to Misc/WindowsXPVisualStudio/VB4.0/Form1.frm
diff --git a/WindowsXPVisualStudio/VB4.0/Form1.frx b/Misc/WindowsXPVisualStudio/VB4.0/Form1.frx
similarity index 100%
rename from WindowsXPVisualStudio/VB4.0/Form1.frx
rename to Misc/WindowsXPVisualStudio/VB4.0/Form1.frx
diff --git a/WindowsXPVisualStudio/VB4.0/Project1.vbp b/Misc/WindowsXPVisualStudio/VB4.0/Project1.vbp
similarity index 100%
rename from WindowsXPVisualStudio/VB4.0/Project1.vbp
rename to Misc/WindowsXPVisualStudio/VB4.0/Project1.vbp
diff --git a/WindowsXPVisualStudio/VB4.0/untitled.rpt b/Misc/WindowsXPVisualStudio/VB4.0/untitled.rpt
similarity index 100%
rename from WindowsXPVisualStudio/VB4.0/untitled.rpt
rename to Misc/WindowsXPVisualStudio/VB4.0/untitled.rpt
diff --git a/WindowsXPVisualStudio/VB6.0/Module1.bas b/Misc/WindowsXPVisualStudio/VB6.0/Module1.bas
similarity index 100%
rename from WindowsXPVisualStudio/VB6.0/Module1.bas
rename to Misc/WindowsXPVisualStudio/VB6.0/Module1.bas
diff --git a/WindowsXPVisualStudio/VB6.0/Project1.RES b/Misc/WindowsXPVisualStudio/VB6.0/Project1.RES
similarity index 100%
rename from WindowsXPVisualStudio/VB6.0/Project1.RES
rename to Misc/WindowsXPVisualStudio/VB6.0/Project1.RES
diff --git a/WindowsXPVisualStudio/VB6.0/Project1.vbp b/Misc/WindowsXPVisualStudio/VB6.0/Project1.vbp
similarity index 100%
rename from WindowsXPVisualStudio/VB6.0/Project1.vbp
rename to Misc/WindowsXPVisualStudio/VB6.0/Project1.vbp
diff --git a/WindowsXPVisualStudio/VB6.0/frmAbout.frm b/Misc/WindowsXPVisualStudio/VB6.0/frmAbout.frm
similarity index 100%
rename from WindowsXPVisualStudio/VB6.0/frmAbout.frm
rename to Misc/WindowsXPVisualStudio/VB6.0/frmAbout.frm
diff --git a/WindowsXPVisualStudio/VB6.0/frmAbout.frx b/Misc/WindowsXPVisualStudio/VB6.0/frmAbout.frx
similarity index 100%
rename from WindowsXPVisualStudio/VB6.0/frmAbout.frx
rename to Misc/WindowsXPVisualStudio/VB6.0/frmAbout.frx
diff --git a/WindowsXPVisualStudio/VB6.0/frmBrowser.frm b/Misc/WindowsXPVisualStudio/VB6.0/frmBrowser.frm
similarity index 100%
rename from WindowsXPVisualStudio/VB6.0/frmBrowser.frm
rename to Misc/WindowsXPVisualStudio/VB6.0/frmBrowser.frm
diff --git a/WindowsXPVisualStudio/VB6.0/frmBrowser.frx b/Misc/WindowsXPVisualStudio/VB6.0/frmBrowser.frx
similarity index 100%
rename from WindowsXPVisualStudio/VB6.0/frmBrowser.frx
rename to Misc/WindowsXPVisualStudio/VB6.0/frmBrowser.frx
diff --git a/WindowsXPVisualStudio/VB6.0/frmDocument.frm b/Misc/WindowsXPVisualStudio/VB6.0/frmDocument.frm
similarity index 100%
rename from WindowsXPVisualStudio/VB6.0/frmDocument.frm
rename to Misc/WindowsXPVisualStudio/VB6.0/frmDocument.frm
diff --git a/WindowsXPVisualStudio/VB6.0/frmDocument.frx b/Misc/WindowsXPVisualStudio/VB6.0/frmDocument.frx
similarity index 100%
rename from WindowsXPVisualStudio/VB6.0/frmDocument.frx
rename to Misc/WindowsXPVisualStudio/VB6.0/frmDocument.frx
diff --git a/WindowsXPVisualStudio/VB6.0/frmMain.frm b/Misc/WindowsXPVisualStudio/VB6.0/frmMain.frm
similarity index 100%
rename from WindowsXPVisualStudio/VB6.0/frmMain.frm
rename to Misc/WindowsXPVisualStudio/VB6.0/frmMain.frm
diff --git a/WindowsXPVisualStudio/VB6.0/frmMain.frx b/Misc/WindowsXPVisualStudio/VB6.0/frmMain.frx
similarity index 100%
rename from WindowsXPVisualStudio/VB6.0/frmMain.frx
rename to Misc/WindowsXPVisualStudio/VB6.0/frmMain.frx
diff --git a/WindowsXPVisualStudio/VB6.0/frmSplash.frm b/Misc/WindowsXPVisualStudio/VB6.0/frmSplash.frm
similarity index 100%
rename from WindowsXPVisualStudio/VB6.0/frmSplash.frm
rename to Misc/WindowsXPVisualStudio/VB6.0/frmSplash.frm
diff --git a/WindowsXPVisualStudio/VB6.0/frmSplash.frx b/Misc/WindowsXPVisualStudio/VB6.0/frmSplash.frx
similarity index 100%
rename from WindowsXPVisualStudio/VB6.0/frmSplash.frx
rename to Misc/WindowsXPVisualStudio/VB6.0/frmSplash.frx
diff --git a/WindowsXPVisualStudio/VS2003/WindowsApplication1/WindowsApplication1.sln b/Misc/WindowsXPVisualStudio/VS2003/WindowsApplication1/WindowsApplication1.sln
similarity index 100%
rename from WindowsXPVisualStudio/VS2003/WindowsApplication1/WindowsApplication1.sln
rename to Misc/WindowsXPVisualStudio/VS2003/WindowsApplication1/WindowsApplication1.sln
diff --git a/WindowsXPVisualStudio/VS2003/WindowsApplication1/WindowsApplication1/AssemblyInfo.vb b/Misc/WindowsXPVisualStudio/VS2003/WindowsApplication1/WindowsApplication1/AssemblyInfo.vb
similarity index 100%
rename from WindowsXPVisualStudio/VS2003/WindowsApplication1/WindowsApplication1/AssemblyInfo.vb
rename to Misc/WindowsXPVisualStudio/VS2003/WindowsApplication1/WindowsApplication1/AssemblyInfo.vb
diff --git a/WindowsXPVisualStudio/VS2003/WindowsApplication1/WindowsApplication1/Form1.resx b/Misc/WindowsXPVisualStudio/VS2003/WindowsApplication1/WindowsApplication1/Form1.resx
similarity index 100%
rename from WindowsXPVisualStudio/VS2003/WindowsApplication1/WindowsApplication1/Form1.resx
rename to Misc/WindowsXPVisualStudio/VS2003/WindowsApplication1/WindowsApplication1/Form1.resx
diff --git a/WindowsXPVisualStudio/VS2003/WindowsApplication1/WindowsApplication1/Form1.vb b/Misc/WindowsXPVisualStudio/VS2003/WindowsApplication1/WindowsApplication1/Form1.vb
similarity index 100%
rename from WindowsXPVisualStudio/VS2003/WindowsApplication1/WindowsApplication1/Form1.vb
rename to Misc/WindowsXPVisualStudio/VS2003/WindowsApplication1/WindowsApplication1/Form1.vb
diff --git a/WindowsXPVisualStudio/VS2003/WindowsApplication1/WindowsApplication1/WindowsApplication1.vbproj b/Misc/WindowsXPVisualStudio/VS2003/WindowsApplication1/WindowsApplication1/WindowsApplication1.vbproj
similarity index 100%
rename from WindowsXPVisualStudio/VS2003/WindowsApplication1/WindowsApplication1/WindowsApplication1.vbproj
rename to Misc/WindowsXPVisualStudio/VS2003/WindowsApplication1/WindowsApplication1/WindowsApplication1.vbproj
diff --git a/WindowsXPVisualStudio/VS2010/WpfApplication1/WpfApplication1.sln b/Misc/WindowsXPVisualStudio/VS2010/WpfApplication1/WpfApplication1.sln
similarity index 100%
rename from WindowsXPVisualStudio/VS2010/WpfApplication1/WpfApplication1.sln
rename to Misc/WindowsXPVisualStudio/VS2010/WpfApplication1/WpfApplication1.sln
diff --git a/WindowsXPVisualStudio/VS2010/WpfApplication1/WpfApplication1/App.xaml b/Misc/WindowsXPVisualStudio/VS2010/WpfApplication1/WpfApplication1/App.xaml
similarity index 100%
rename from WindowsXPVisualStudio/VS2010/WpfApplication1/WpfApplication1/App.xaml
rename to Misc/WindowsXPVisualStudio/VS2010/WpfApplication1/WpfApplication1/App.xaml
diff --git a/WindowsXPVisualStudio/VS2010/WpfApplication1/WpfApplication1/App.xaml.cs b/Misc/WindowsXPVisualStudio/VS2010/WpfApplication1/WpfApplication1/App.xaml.cs
similarity index 100%
rename from WindowsXPVisualStudio/VS2010/WpfApplication1/WpfApplication1/App.xaml.cs
rename to Misc/WindowsXPVisualStudio/VS2010/WpfApplication1/WpfApplication1/App.xaml.cs
diff --git a/WindowsXPVisualStudio/VS2010/WpfApplication1/WpfApplication1/MainWindow.xaml b/Misc/WindowsXPVisualStudio/VS2010/WpfApplication1/WpfApplication1/MainWindow.xaml
similarity index 100%
rename from WindowsXPVisualStudio/VS2010/WpfApplication1/WpfApplication1/MainWindow.xaml
rename to Misc/WindowsXPVisualStudio/VS2010/WpfApplication1/WpfApplication1/MainWindow.xaml
diff --git a/WindowsXPVisualStudio/VS2010/WpfApplication1/WpfApplication1/MainWindow.xaml.cs b/Misc/WindowsXPVisualStudio/VS2010/WpfApplication1/WpfApplication1/MainWindow.xaml.cs
similarity index 100%
rename from WindowsXPVisualStudio/VS2010/WpfApplication1/WpfApplication1/MainWindow.xaml.cs
rename to Misc/WindowsXPVisualStudio/VS2010/WpfApplication1/WpfApplication1/MainWindow.xaml.cs
diff --git a/WindowsXPVisualStudio/VS2010/WpfApplication1/WpfApplication1/Properties/AssemblyInfo.cs b/Misc/WindowsXPVisualStudio/VS2010/WpfApplication1/WpfApplication1/Properties/AssemblyInfo.cs
similarity index 100%
rename from WindowsXPVisualStudio/VS2010/WpfApplication1/WpfApplication1/Properties/AssemblyInfo.cs
rename to Misc/WindowsXPVisualStudio/VS2010/WpfApplication1/WpfApplication1/Properties/AssemblyInfo.cs
diff --git a/WindowsXPVisualStudio/VS2010/WpfApplication1/WpfApplication1/Properties/Resources.Designer.cs b/Misc/WindowsXPVisualStudio/VS2010/WpfApplication1/WpfApplication1/Properties/Resources.Designer.cs
similarity index 100%
rename from WindowsXPVisualStudio/VS2010/WpfApplication1/WpfApplication1/Properties/Resources.Designer.cs
rename to Misc/WindowsXPVisualStudio/VS2010/WpfApplication1/WpfApplication1/Properties/Resources.Designer.cs
diff --git a/Misc/WindowsXPVisualStudio/VS2010/WpfApplication1/WpfApplication1/Properties/Resources.resx b/Misc/WindowsXPVisualStudio/VS2010/WpfApplication1/WpfApplication1/Properties/Resources.resx
new file mode 100644
index 0000000..af7dbeb
--- /dev/null
+++ b/Misc/WindowsXPVisualStudio/VS2010/WpfApplication1/WpfApplication1/Properties/Resources.resx
@@ -0,0 +1,117 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/WindowsXPVisualStudio/VS2010/WpfApplication1/WpfApplication1/Properties/Settings.Designer.cs b/Misc/WindowsXPVisualStudio/VS2010/WpfApplication1/WpfApplication1/Properties/Settings.Designer.cs
similarity index 100%
rename from WindowsXPVisualStudio/VS2010/WpfApplication1/WpfApplication1/Properties/Settings.Designer.cs
rename to Misc/WindowsXPVisualStudio/VS2010/WpfApplication1/WpfApplication1/Properties/Settings.Designer.cs
diff --git a/WindowsXPVisualStudio/VS2010/WpfApplication1/WpfApplication1/Properties/Settings.settings b/Misc/WindowsXPVisualStudio/VS2010/WpfApplication1/WpfApplication1/Properties/Settings.settings
similarity index 100%
rename from WindowsXPVisualStudio/VS2010/WpfApplication1/WpfApplication1/Properties/Settings.settings
rename to Misc/WindowsXPVisualStudio/VS2010/WpfApplication1/WpfApplication1/Properties/Settings.settings
diff --git a/WindowsXPVisualStudio/VS2010/WpfApplication1/WpfApplication1/WpfApplication1.csproj b/Misc/WindowsXPVisualStudio/VS2010/WpfApplication1/WpfApplication1/WpfApplication1.csproj
similarity index 100%
rename from WindowsXPVisualStudio/VS2010/WpfApplication1/WpfApplication1/WpfApplication1.csproj
rename to Misc/WindowsXPVisualStudio/VS2010/WpfApplication1/WpfApplication1/WpfApplication1.csproj
diff --git a/ObsoleteAttributeOnInterfaces022015/ObsoleteAttributeOnInterfaces/ObsoleteAttributeOnInterfaces.csproj b/ObsoleteAttributeOnInterfaces022015/ObsoleteAttributeOnInterfaces/ObsoleteAttributeOnInterfaces.csproj
deleted file mode 100644
index 0019e85..0000000
--- a/ObsoleteAttributeOnInterfaces022015/ObsoleteAttributeOnInterfaces/ObsoleteAttributeOnInterfaces.csproj
+++ /dev/null
@@ -1,55 +0,0 @@
-
-
-
-
- Debug
- AnyCPU
- {484E2C46-3024-4E03-8390-F80B54707048}
- Exe
- Properties
- ObsoleteAttributeOnInterfaces
- ObsoleteAttributeOnInterfaces
- v4.5
- 512
-
-
- true
- full
- false
- bin\Debug\
- DEBUG;TRACE
- prompt
- 4
-
-
- pdbonly
- true
- bin\Release\
- TRACE
- prompt
- 4
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ObsoleteAttributeOnInterfaces022015/ObsoleteAttributeOnInterfaces/Program.cs b/ObsoleteAttributeOnInterfaces022015/ObsoleteAttributeOnInterfaces/Program.cs
deleted file mode 100644
index 4c40469..0000000
--- a/ObsoleteAttributeOnInterfaces022015/ObsoleteAttributeOnInterfaces/Program.cs
+++ /dev/null
@@ -1,55 +0,0 @@
-using System;
-
-namespace ObsoleteAttributeOnInterfaces
-{
- public static class Program
- {
- public static void Main()
- {
- ISampleClass sc1 = new SampleClass();
- sc1.SomeOldMethod();
-
- ISampleClass sc2 = new SampleClass2();
- sc2.SomeOldMethod();
-
- ISampleClass sc3 = new SampleClass3();
- sc3.SomeOldMethod();
-
-
-
- SampleClass sc = new SampleClass();
- sc.SomeOldMethod();
-
- }
- }
-
- public interface ISampleClass
- {
- void SomeOldMethod();
- }
-
- public class SampleClass : ISampleClass
- {
- [Obsolete("This is the old way. No one uses it anymore. Shame on you!!", true)]
- public void SomeOldMethod()
- {
- // This is old. I should probably remove and refactor, but I'm too scared.
- }
- }
-
- public class SampleClass2 : ISampleClass
- {
- public void SomeOldMethod()
- {
- // Old, but not obsolete.
- }
- }
-
- public class SampleClass3 : ISampleClass
- {
- public void SomeOldMethod()
- {
- // Why mess with perfection?
- }
- }
-}
diff --git a/PassingDataBetweenForms/1_PushingDataBackToParentForm/Form2.cs b/PassingDataBetweenForms/1_PushingDataBackToParentForm/Form2.cs
deleted file mode 100644
index 07a7fbb..0000000
--- a/PassingDataBetweenForms/1_PushingDataBackToParentForm/Form2.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-using System;
-using System.Windows.Forms;
-
-namespace PushingDataBackToParentForm
-{
- public partial class Form2 : Form
- {
- private Form1 form1;
-
- public Form2(Form1 form1)
- {
- InitializeComponent();
- this.form1 = form1;
- }
-
- private void btnSaveInput_Click(object sender, EventArgs e)
- {
- form1.SetName(txtName.Text);
-
- int age;
- if (int.TryParse(txtAge.Text, out age))
- form1.Age = age;
-
- this.Close();
- }
- }
-}
diff --git a/PassingDataBetweenForms/2_PushingDataBackToOneOfMultipleForms/DetailForm.cs b/PassingDataBetweenForms/2_PushingDataBackToOneOfMultipleForms/DetailForm.cs
deleted file mode 100644
index 5d5259d..0000000
--- a/PassingDataBetweenForms/2_PushingDataBackToOneOfMultipleForms/DetailForm.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-using System;
-using System.Windows.Forms;
-
-namespace PushingDataBackToOneOfMultipleForms
-{
- public partial class DetailForm : Form
- {
- private StudentForm studentForm;
- private EmployeeForm employeeForm;
- private SomeClass someClass;
-
- public DetailForm(StudentForm form)
- {
- InitializeComponent();
- studentForm = form;
- }
-
- public DetailForm(EmployeeForm form)
- {
- InitializeComponent();
- employeeForm = form;
- }
-
- public DetailForm(SomeClass someClass)
- {
- InitializeComponent();
- this.someClass = someClass;
- }
-
- private void btnSaveInput_Click(object sender, EventArgs e)
- {
- if (studentForm != null)
- studentForm.SetStudentName(txtName.Text);
- else if (employeeForm != null)
- employeeForm.EmployeeName = txtName.Text;
- else if (someClass != null)
- someClass.Name = txtName.Text;
-
- this.Close();
- }
- }
-}
diff --git a/PassingDataBetweenForms/2_PushingDataBackToOneOfMultipleForms/SomeClass.cs b/PassingDataBetweenForms/2_PushingDataBackToOneOfMultipleForms/SomeClass.cs
deleted file mode 100644
index 1d00854..0000000
--- a/PassingDataBetweenForms/2_PushingDataBackToOneOfMultipleForms/SomeClass.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-namespace PushingDataBackToOneOfMultipleForms
-{
- public class SomeClass
- {
- public void SomeMethod()
- {
- using (var detailForm = new DetailForm(this))
- {
- detailForm.ShowDialog();
- }
- }
-
- public string Name { get; set; }
- }
-}
diff --git a/PassingDataBetweenForms/3_PullingDataFromChildForm/3_PullingDataFromChildForm.csproj.user b/PassingDataBetweenForms/3_PullingDataFromChildForm/3_PullingDataFromChildForm.csproj.user
deleted file mode 100644
index a4a6cdf..0000000
--- a/PassingDataBetweenForms/3_PullingDataFromChildForm/3_PullingDataFromChildForm.csproj.user
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
- ProjectFiles
-
-
\ No newline at end of file
diff --git a/PassingDataBetweenForms/3_PullingDataFromChildForm/DetailForm.cs b/PassingDataBetweenForms/3_PullingDataFromChildForm/DetailForm.cs
deleted file mode 100644
index 3d12347..0000000
--- a/PassingDataBetweenForms/3_PullingDataFromChildForm/DetailForm.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-using System;
-using System.Windows.Forms;
-
-namespace PullingDataFromChildForm
-{
- public partial class DetailForm : Form
- {
- public DetailForm()
- {
- InitializeComponent();
- }
-
- public string Name
- {
- get { return txtName.Text; }
- }
-
- public int Age
- {
- get
- {
- int result;
- Int32.TryParse(txtAge.Text, out result);
- return result;
- }
- }
-
- // Even this could be removed, if you set this button as the Accept
- // button on the Form, or set a DialogResult value on the button
- private void btnSaveInput_Click(object sender, EventArgs e)
- {
- this.Close();
- }
- }
-}
diff --git a/PassingDataBetweenForms/3_PullingDataFromChildForm/EmployeeForm.cs b/PassingDataBetweenForms/3_PullingDataFromChildForm/EmployeeForm.cs
deleted file mode 100644
index b0a1136..0000000
--- a/PassingDataBetweenForms/3_PullingDataFromChildForm/EmployeeForm.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-using System;
-using System.Windows.Forms;
-
-namespace PullingDataFromChildForm
-{
- public partial class EmployeeForm : Form
- {
- public EmployeeForm()
- {
- InitializeComponent();
- }
-
- private void btnGetUserInput_Click(object sender, EventArgs e)
- {
- using (var detailForm = new DetailForm())
- {
- detailForm.ShowDialog();
-
- EmployeeName = detailForm.Name;
- }
- }
-
- public string EmployeeName
- {
- set { lblName.Text = value; }
- }
- }
-}
diff --git a/PassingDataBetweenForms/3_PullingDataFromChildForm/SomeClass.cs b/PassingDataBetweenForms/3_PullingDataFromChildForm/SomeClass.cs
deleted file mode 100644
index c24569d..0000000
--- a/PassingDataBetweenForms/3_PullingDataFromChildForm/SomeClass.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-namespace PullingDataFromChildForm
-{
- public class SomeClass
- {
- public void SomeMethod()
- {
- using (var detailForm = new DetailForm())
- {
- detailForm.ShowDialog();
-
- Name = detailForm.Name;
- Age = detailForm.Age;
- }
- }
-
- public string Name { get; set; }
-
- public int Age { get; set; }
- }
-}
diff --git a/PassingDataBetweenForms/3_PullingDataFromChildForm/StudentForm.cs b/PassingDataBetweenForms/3_PullingDataFromChildForm/StudentForm.cs
deleted file mode 100644
index bd35054..0000000
--- a/PassingDataBetweenForms/3_PullingDataFromChildForm/StudentForm.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-using System;
-using System.Windows.Forms;
-
-namespace PullingDataFromChildForm
-{
- public partial class StudentForm : Form
- {
- public StudentForm()
- {
- InitializeComponent();
- }
-
- private void btnGetUserInput_Click(object sender, EventArgs e)
- {
- using (var detailForm = new DetailForm())
- {
- detailForm.ShowDialog();
-
- SetStudentName(detailForm.Name);
- }
- }
-
- public void SetStudentName(string name)
- {
- lblStudentName.Text = name;
- }
- }
-}
diff --git a/PassingDataBetweenForms/README.md b/PassingDataBetweenForms/README.md
deleted file mode 100644
index 871025c..0000000
--- a/PassingDataBetweenForms/README.md
+++ /dev/null
@@ -1,3 +0,0 @@
-Passing data between two Forms in WinForms
-
-http://grantwinney.com/passing-data-between-two-forms-in-winforms/
\ No newline at end of file
diff --git a/README.md b/README.md
index 29e68c6..029be5e 100644
--- a/README.md
+++ b/README.md
@@ -1,47 +1,56 @@
-# My Blog Code Samples
-
-This repository contains some of the (usually lengthier) code samples from my blog posts. I also tend to host shorter snippets on [Gist](https://gist.github.com/grantwinney) and [JsFiddle](https://jsfiddle.net/user/grantwinney/fiddles/), and embed them into posts.
-
-The following list of blog posts includes a link to the part of the repo with the relevant code for that post.
-
-* [A sample C# app for generating and verifying TOTP 2FA codes](https://grantwinney.com/a-sample-csharp-app-for-generating-and-verifying-totp-2fa-codes/)
-[💾](https://github.com/grantwinney/BlogCodeSamples/tree/master/2FAQrCode)
-* [An explanation of implicit and explicit conversion in C#](https://grantwinney.com/an-explanation-of-implicit-and-explicit-conversion-in-c/)
-[💾](https://github.com/grantwinney/BlogCodeSamples/tree/master/ImplicitExplicitOperators022015)
-* [An extension method for passing a column name to SqlDataReader.GetFieldValue in C#](https://grantwinney.com/an-extension-method-for-passing-a-column-name-to-sqldatareader-getfieldvalue-in-c/)
-[💾](https://github.com/grantwinney/BlogCodeSamples/tree/master/SqlDataReaderGetFieldValueByName)
-* [Async and PLINQ](https://grantwinney.com/async-and-plinq/)
-[💾](https://github.com/grantwinney/BlogCodeSamples/tree/master/AsyncAndPlinq112013)
-* [Cool markdown tricks for GitHub](https://grantwinney.com/cool-markdown-tricks-for-github/)
-[💾](https://github.com/grantwinney/BlogCodeSamples/tree/master/GitHubTipsTricks)
-* [Discover where the ISS is, where it will be, and who's on it with the ISS Notify API](https://grantwinney.com/day-11-iss-notify-api/)
-[💾](https://github.com/grantwinney/BlogCodeSamples/tree/master/IssNotifyApiWrapper)
-* [How do I convert my code from C# to VB.NET (or from VB.NET to C#)?](https://grantwinney.com/how-do-i-convert-my-code-from-c-to-vb-net-or-vice-versa/)
-[💾](https://github.com/grantwinney/BlogCodeSamples/tree/master/CSharpAndVbNetTogether)
-* [How to use an application config file with a .NET Standard app and NUnit 3)](https://grantwinney.com/how-to-use-an-app-config-file-with-a-net-standard-app-and-nunit-3/)
-[💾](https://github.com/grantwinney/BlogCodeSamples/tree/master/ReadingConfigFile)
-* [Keep your EUnit teardown logic as simple as possible!](https://grantwinney.com/keep-your-eunit-teardown-logic-as-simple/)
-[💾](https://github.com/grantwinney/BlogCodeSamples/tree/master/MeckTeardownTest)
-* [Keep the plumbing out of my living room](https://grantwinney.com/keep-the-plumbing-out-of-my-living-room/)
-[💾](https://github.com/grantwinney/BlogCodeSamples/tree/master/GetKnownFolders)
-* [What is mocking a dependency?)](https://grantwinney.com/what-is-mocking-a-dependency/)
-[💾](https://github.com/grantwinney/BlogCodeSamples/tree/master/MockingDependencies)
-* [Passing data between two Forms in WinForms](https://grantwinney.com/passing-data-between-two-forms-in-winforms/)
-[💾](https://github.com/grantwinney/BlogCodeSamples/tree/master/PassingDataBetweenForms)
-* [Practical Examples of C# Attributes](https://grantwinney.com/5-examples-of-attributes-in-c-and-why-youll-want-to-make-your-own/)
-[💾](https://github.com/grantwinney/BlogCodeSamples/tree/master/AttributesExamples)
-* [Querying Amazon's product details with the Amazon Product Advertising API](https://grantwinney.com/querying-amazon-product-details-with-the-amazon-product-advertising-api/)
-[💾](https://github.com/grantwinney/BlogCodeSamples/tree/master/AmazonProductAdvertisingApiBlogPost)
-* [Running Windows XP in VirtualBox](https://grantwinney.com/running-windows-xp-in-virtualbox/)
-[💾](https://github.com/grantwinney/BlogCodeSamples/tree/master/WindowsXPVisualStudio)
-* [The effect of the Obsolete attribute on a class is ignored when there's an interface involved](https://grantwinney.com/the-effect-of-the-obsolete-attribute-on-a-class-is-ignored-when-theres-an-interface-involved/)
-[💾](https://github.com/grantwinney/BlogCodeSamples/tree/master/ObsoleteAttributeOnInterfaces022015)
-* [A briefly longish tour of Visual Studio for Mac](https://grantwinney.com/a-brief-tour-of-visual-studio-for-mac/)
-[💾](https://github.com/grantwinney/BlogCodeSamples/tree/master/TourVisualStudioForMac)
-* [Using a TextBox and CollectionViewSource to Filter a ListView in WPF](https://grantwinney.com/using-a-textbox-and-collectionviewsource-to-filter-a-listview-in-wpf/)
-[💾](https://github.com/grantwinney/BlogCodeSamples/tree/master/CollectionViewSourceSample)
-* [Using Annotations to Assist ReSharper in Analyzing Your Code](https://grantwinney.com/using-annotations-to-help-resharper-analyze-your-code/)
-[💾](https://github.com/grantwinney/BlogCodeSamples/tree/master/UsingAnnotationsToAssistReSharper)
-* [What's a word cloud and how do I make one?](https://grantwinney.com/whats-a-word-cloud-and-how-do-i-make-one/)[💾](https://github.com/grantwinney/BlogCodeSamples/tree/master/WordCloud)
-* [When an assert isn't assertive enough (or using the wrong macro in an EUnit test)](https://grantwinney.com/when-an-assert-isnt-assertive-enough/)
-[💾](https://github.com/grantwinney/BlogCodeSamples/tree/master/EUnitAssertProblem)
+# Code Samples - Grant's Blog
+
+This repository contains some code samples from [my blog posts](https://grantwinney.com). I sometimes upload code to separate repos (like for [C# / .NET](https://github.com/grantwinney/CSharpDotNetExamples) and [WinForms](https://github.com/grantwinney/Surviving-WinForms)), or to [Gist](https://gist.github.com/grantwinney) or [JsFiddle](https://jsfiddle.net/user/grantwinney/fiddles/) for shorter snippets.
+
+The list below has a link to each blog post, followed by the relevant code for that post.
+
+# APIs
+
+* Discover where the ISS is, where it will be, and who's on it with the ISS Notify API ([blog](https://grantwinney.com/what-is-iss-notify-api/), [code](https://github.com/grantwinney/BlogCodeSamples/tree/master/APIs/IssNotifyApiWrapper))
+
+# Dev Tools
+
+* Can I compare files using VS Code? ([blog](https://grantwinney.com/how-to-compare-files-using-vs-code/), [code](https://github.com/grantwinney/BlogCodeSamples/tree/master/DevTools/CompareInVSCode))
+* Cool markdown tricks for GitHub ([blog](https://grantwinney.com/cool-markdown-tricks-for-github/), [code](https://github.com/grantwinney/BlogCodeSamples/tree/master/DevTools/GitHubTipsTricks))
+* Why doesn't VS 2022 show my WinForms UI at design time? ([blog](http://grantwinney.com/why-doesnt-vs2022-show-my-winforms-ui/), [code](https://github.com/grantwinney/BlogCodeSamples/tree/master/DevTools/WinFormsDesignerInVS2022))
+* What is a Git alias? ([blog](https://grantwinney.com/what-is-a-git-alias-and-how-do-i-use-it/), [code](https://github.com/grantwinney/BlogCodeSamples/tree/master/DevTools/GitAliasTemplate))
+
+# Frameworks
+
+## ASP.NET Core
+
+* Similar endpoints, swagger pages, and a DevOps fail ([blog](https://grantwinney.com/similar-endpoints-swagger-pages-and-a-devops-fail), [code](https://github.com/grantwinney/BlogCodeSamples/tree/master/Frameworks/AspNetCore/MinimalAPIWithSimilarEndpoints))
+
+## WinForms
+
+* Passing Data Between Forms in WinForms ([blog](https://grantwinney.com/passing-data-between-two-forms-in-winforms/), [code](https://github.com/grantwinney/BlogCodeSamples/tree/master/Frameworks/WinForms/PassingDataBetweenForms))
+
+## WPF
+
+* Filtering a ListView in WPF Using a TextBox and CollectionViewSource ([blog](https://grantwinney.com/wpf-filtering-listview-using-textbox-and-collectionviewsource/), [code](https://github.com/grantwinney/BlogCodeSamples/tree/master/Frameworks/WPF/CollectionViewSourceSample))
+
+# Languages
+
+## C#
+
+* An Extension Method to Pass a Column Name to SqlDataReader.GetFieldValue ([blog](https://grantwinney.com/csharp-extension-method-to-pass-column-name-to-getfieldvalue/), [code](https://github.com/grantwinney/BlogCodeSamples/tree/master/Languages/CSharp/SqlDataReaderGetFieldValueByName))
+* How do I convert my code from C# to VB.NET (or from VB.NET to C#)? ([blog](https://grantwinney.com/how-do-i-convert-my-code-from-c-to-vb-net-or-vice-versa/), [code](https://github.com/grantwinney/BlogCodeSamples/tree/master/CSharpAndVbNetTogether))
+* How to generate and verify TOTP 2FA codes (in C#) ([blog](https://grantwinney.com/a-sample-csharp-app-for-generating-and-verifying-totp-2fa-codes/), [code](https://github.com/grantwinney/BlogCodeSamples/tree/master/Languages/CSharp/2FAQrCode))
+* Obsolete Attribute on a Class is Ignored When an Interface is Involved ([blog](https://grantwinney.com/csharp-obsolete-attribute-on-class-ignored-when-interface-is-involved/), [code](https://github.com/grantwinney/BlogCodeSamples/tree/master/Languages/CSharp/ObsoleteAttributeOnInterfaces))
+* Using an application config file with a .NET Standard app and NUnit 3 ([blog](https://grantwinney.com/how-to-use-an-app-config-file-with-a-net-standard-app-and-nunit-3/), [code](https://github.com/grantwinney/BlogCodeSamples/tree/master/Languages/CSharp/ReadingConfigFile))
+* What is mocking a dependency? ([blog](https://grantwinney.com/what-is-mocking-a-dependency/), [code](https://github.com/grantwinney/BlogCodeSamples/tree/master/Languages/CSharp/MockingDependencies))
+* What is the NUnit constraint model and should you use it? ([blog](https://grantwinney.com/5-reasons-to-use-nunits-constraint-model), [code](https://github.com/grantwinney/BlogCodeSamples/tree/master/Languages/CSharp/NUnitConstraintModel))
+
+## Erlang
+
+* Calculate Easter and other holidays in Erlang ([blog](https://grantwinney.com/how-to-calculate-easter-and-other-holidays-in-erlang/), [code](https://github.com/grantwinney/BlogCodeSamples/tree/master/Languages/Erlang/CalculateHolidays))
+* Keep your EUnit teardown logic as simple as possible! ([blog](https://grantwinney.com/keep-your-eunit-teardown-logic-as-simple/), [code](https://github.com/grantwinney/BlogCodeSamples/tree/master/Languages/Erlang/MeckTeardownTest))
+* Modify a config file in Erlang ([blog](https://grantwinney.com/how-to-modify-a-config-file-in-erlang/), [code](https://github.com/grantwinney/BlogCodeSamples/tree/master/Languages/Erlang/ConfigFileModifier))
+
+# Misc
+
+* Creating Your First Chrome Extension ([blog](https://grantwinney.com/making-your-first-chrome-extension/), [code](https://github.com/grantwinney/BlogCodeSamples/tree/master/Misc/ChromeExtensionSamples))
+* Running Windows XP in VirtualBox ([blog](https://grantwinney.com/running-windows-xp-in-virtualbox/), [code](https://github.com/grantwinney/BlogCodeSamples/tree/master/Misc/WindowsXPVisualStudio))
+* Tweet random posts from a Ghost blog using AWS Lambda ([blog](https://grantwinney.com/using-aws-lambda-and-tweetinvi-to-tweet-a-random-ghost-blog-post/), [code](https://github.com/grantwinney/BlogCodeSamples/tree/master/Misc/TweetRandomPostFromAGhostBlog))
+* Tweet random blog posts from an RSS feed using AWS Lambda ([blog](https://grantwinney.com/using-aws-lambda-to-tweet-random-posts-from-an-rss-feed/), [code](https://github.com/grantwinney/BlogCodeSamples/tree/master/Misc/TweetRandomFeedItem))
+* Where should I store application data in Windows? ([blog](https://grantwinney.com/where-should-i-store-app-data-in-windows/), [code](https://github.com/grantwinney/BlogCodeSamples/tree/master/Misc/GetKnownFolders))
diff --git a/SqlDataReaderGetFieldValueByName/README.md b/SqlDataReaderGetFieldValueByName/README.md
deleted file mode 100644
index 539604f..0000000
--- a/SqlDataReaderGetFieldValueByName/README.md
+++ /dev/null
@@ -1,3 +0,0 @@
-An extension method for passing a column name to SqlDataReader.GetFieldValue in C#
-
-http://grantwinney.com/an-extension-method-for-passing-a-column-name-to-sqldatareader-getfieldvalue-in-c/
\ No newline at end of file
diff --git a/SqlDataReaderGetFieldValueByName/SqlDataReaderGetFieldValueByName/SqlDataReaderGetFieldValueByName.csproj b/SqlDataReaderGetFieldValueByName/SqlDataReaderGetFieldValueByName/SqlDataReaderGetFieldValueByName.csproj
deleted file mode 100644
index 72a2345..0000000
--- a/SqlDataReaderGetFieldValueByName/SqlDataReaderGetFieldValueByName/SqlDataReaderGetFieldValueByName.csproj
+++ /dev/null
@@ -1,53 +0,0 @@
-
-
-
-
- Debug
- AnyCPU
- {09DFC1D5-1CA7-411B-AC3C-483337207244}
- Library
- Properties
- SqlDataReaderGetFieldValueByName
- SqlDataReaderGetFieldValueByName
- v4.5
- 512
-
-
- true
- full
- false
- bin\Debug\
- DEBUG;TRACE
- prompt
- 4
-
-
- pdbonly
- true
- bin\Release\
- TRACE
- prompt
- 4
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/SqlDataReaderGetFieldValueByName/SqlDataReaderGetFieldValueByName/StudentDataAccess.cs b/SqlDataReaderGetFieldValueByName/SqlDataReaderGetFieldValueByName/StudentDataAccess.cs
deleted file mode 100644
index fd18649..0000000
--- a/SqlDataReaderGetFieldValueByName/SqlDataReaderGetFieldValueByName/StudentDataAccess.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-using System.Data.SqlClient;
-
-namespace SqlDataReaderGetFieldValueByName
-{
- public class StudentDataAccess
- {
- public void GetStudents()
- {
- using (var conn = new SqlConnection("yourConnectionString"))
- {
- using (var cmd = new SqlCommand("SELECT name, age FROM students", conn))
- {
- conn.Open();
-
- using (var dr = cmd.ExecuteReader())
- {
- var name = dr.GetFieldValue("name");
-
- var age = dr.GetFieldValue("age");
- }
- }
- }
- }
- }
-
- public static class SqlReaderExtensions
- {
- ///
- /// Gets the value of the specified column as a type, given the column name.
- ///
- /// The expected type of the column being retrieved.
- /// The reader from which to retrieve the column.
- /// The name of the column to be retrieved.
- /// The returned type object.
- public static T GetFieldValue(this SqlDataReader reader, string columnName)
- {
- return reader.GetFieldValue(reader.GetOrdinal(columnName));
- }
- }
-}
diff --git a/TourVisualStudioForMac/LICENSE b/TourVisualStudioForMac/LICENSE
deleted file mode 100644
index 00c19c7..0000000
--- a/TourVisualStudioForMac/LICENSE
+++ /dev/null
@@ -1,21 +0,0 @@
-MIT License
-
-Copyright (c) 2017 Grant Winney
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
diff --git a/TourVisualStudioForMac/README.md b/TourVisualStudioForMac/README.md
deleted file mode 100644
index d650cb1..0000000
--- a/TourVisualStudioForMac/README.md
+++ /dev/null
@@ -1,3 +0,0 @@
-# A Tour of Visual Studio for Mac
-
-[A briefly longish tour of Visual Studio for Mac](https://grantwinney.com/a-brief-tour-of-visual-studio-for-mac/)
diff --git a/TourVisualStudioForMac/vs4mac_console1/.gitignore b/TourVisualStudioForMac/vs4mac_console1/.gitignore
deleted file mode 100644
index 13d2fde..0000000
--- a/TourVisualStudioForMac/vs4mac_console1/.gitignore
+++ /dev/null
@@ -1,40 +0,0 @@
-# Autosave files
-*~
-
-# build
-[Oo]bj/
-[Bb]in/
-packages/
-TestResults/
-
-# globs
-Makefile.in
-*.DS_Store
-*.sln.cache
-*.suo
-*.cache
-*.pidb
-*.userprefs
-*.usertasks
-config.log
-config.make
-config.status
-aclocal.m4
-install-sh
-autom4te.cache/
-*.user
-*.tar.gz
-tarballs/
-test-results/
-Thumbs.db
-
-# Mac bundle stuff
-*.dmg
-*.app
-
-# resharper
-*_Resharper.*
-*.Resharper
-
-# dotCover
-*.dotCover
diff --git a/TourVisualStudioForMac/vs4mac_console1/vs4mac_console1.sln b/TourVisualStudioForMac/vs4mac_console1/vs4mac_console1.sln
deleted file mode 100644
index 1b9c0d6..0000000
--- a/TourVisualStudioForMac/vs4mac_console1/vs4mac_console1.sln
+++ /dev/null
@@ -1,22 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 2012
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "vs4mac_console1", "vs4mac_console1\vs4mac_console1.csproj", "{C165BFE1-47DF-46F6-9B75-704F8421BCEC}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{4C6A3649-33D6-4099-8274-A22F19647CA6}"
- ProjectSection(SolutionItems) = preProject
- vs4mac_console1.sln = vs4mac_console1.sln
- EndProjectSection
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|x86 = Debug|x86
- Release|x86 = Release|x86
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {C165BFE1-47DF-46F6-9B75-704F8421BCEC}.Debug|x86.ActiveCfg = Debug|x86
- {C165BFE1-47DF-46F6-9B75-704F8421BCEC}.Debug|x86.Build.0 = Debug|x86
- {C165BFE1-47DF-46F6-9B75-704F8421BCEC}.Release|x86.ActiveCfg = Release|x86
- {C165BFE1-47DF-46F6-9B75-704F8421BCEC}.Release|x86.Build.0 = Release|x86
- EndGlobalSection
-EndGlobal
diff --git a/TourVisualStudioForMac/vs4mac_console1/vs4mac_console1/Program.cs b/TourVisualStudioForMac/vs4mac_console1/vs4mac_console1/Program.cs
deleted file mode 100644
index 73899d1..0000000
--- a/TourVisualStudioForMac/vs4mac_console1/vs4mac_console1/Program.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-using System;
-using vs4mac_dotnet_standard_library;
-
-namespace vs4mac_console1
-{
- class MainClass
- {
- public static void Main(string[] args)
- {
- var randomNumber = Magicmatics.GimmeRandomNumber();
-
- Console.WriteLine($"Hello World! Your random number is: {randomNumber}");
- }
- }
-}
diff --git a/TourVisualStudioForMac/vs4mac_console1/vs4mac_console1/Properties/AssemblyInfo.cs b/TourVisualStudioForMac/vs4mac_console1/vs4mac_console1/Properties/AssemblyInfo.cs
deleted file mode 100644
index e028123..0000000
--- a/TourVisualStudioForMac/vs4mac_console1/vs4mac_console1/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-using System.Reflection;
-using System.Runtime.CompilerServices;
-
-// Information about this assembly is defined by the following attributes.
-// Change them to the values specific to your project.
-
-[assembly: AssemblyTitle("vs4mac_console1")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("")]
-[assembly: AssemblyCopyright("${AuthorCopyright}")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
-// The form "{Major}.{Minor}.*" will automatically update the build and revision,
-// and "{Major}.{Minor}.{Build}.*" will update just the revision.
-
-[assembly: AssemblyVersion("1.0.*")]
-
-// The following attributes are used to specify the signing key for the assembly,
-// if desired. See the Mono documentation for more information about signing.
-
-//[assembly: AssemblyDelaySign(false)]
-//[assembly: AssemblyKeyFile("")]
diff --git a/TourVisualStudioForMac/vs4mac_console1/vs4mac_console1/packages.config b/TourVisualStudioForMac/vs4mac_console1/vs4mac_console1/packages.config
deleted file mode 100644
index 8707561..0000000
--- a/TourVisualStudioForMac/vs4mac_console1/vs4mac_console1/packages.config
+++ /dev/null
@@ -1,49 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/TourVisualStudioForMac/vs4mac_console1/vs4mac_console1/vs4mac_console1.csproj b/TourVisualStudioForMac/vs4mac_console1/vs4mac_console1/vs4mac_console1.csproj
deleted file mode 100644
index 7b022cf..0000000
--- a/TourVisualStudioForMac/vs4mac_console1/vs4mac_console1/vs4mac_console1.csproj
+++ /dev/null
@@ -1,103 +0,0 @@
-
-
-
- Debug
- x86
- {C165BFE1-47DF-46F6-9B75-704F8421BCEC}
- Exe
- vs4mac_console1
- vs4mac_console1
- v4.6.1
-
-
- true
- full
- false
- bin\Debug
- DEBUG;
- prompt
- 4
- true
- x86
-
-
- true
- bin\Release
- prompt
- 4
- true
- x86
-
-
-
-
- ..\..\vs4mac_dotnet_standard_library\vs4mac_dotnet_standard_library\bin\Debug\netstandard1.4\vs4mac_dotnet_standard_library.dll
-
-
- ..\packages\Microsoft.Win32.Primitives.4.3.0\lib\net46\Microsoft.Win32.Primitives.dll
-
-
-
- ..\packages\System.AppContext.4.3.0\lib\net46\System.AppContext.dll
-
-
-
- ..\packages\System.Console.4.3.0\lib\net46\System.Console.dll
-
-
- ..\packages\System.Diagnostics.DiagnosticSource.4.3.0\lib\net46\System.Diagnostics.DiagnosticSource.dll
-
-
- ..\packages\System.Globalization.Calendars.4.3.0\lib\net46\System.Globalization.Calendars.dll
-
-
- ..\packages\System.IO.Compression.4.3.0\lib\net46\System.IO.Compression.dll
-
-
- ..\packages\System.IO.Compression.ZipFile.4.3.0\lib\net46\System.IO.Compression.ZipFile.dll
-
-
-
- ..\packages\System.IO.FileSystem.Primitives.4.3.0\lib\net46\System.IO.FileSystem.Primitives.dll
-
-
- ..\packages\System.IO.FileSystem.4.3.0\lib\net46\System.IO.FileSystem.dll
-
-
- ..\packages\System.Net.Sockets.4.3.0\lib\net46\System.Net.Sockets.dll
-
-
-
- ..\packages\System.Runtime.InteropServices.RuntimeInformation.4.3.0\lib\net45\System.Runtime.InteropServices.RuntimeInformation.dll
-
-
-
- ..\packages\System.Security.Cryptography.Encoding.4.3.0\lib\net46\System.Security.Cryptography.Encoding.dll
-
-
- ..\packages\System.Security.Cryptography.Primitives.4.3.0\lib\net46\System.Security.Cryptography.Primitives.dll
-
-
- ..\packages\System.Security.Cryptography.Algorithms.4.3.0\lib\net461\System.Security.Cryptography.Algorithms.dll
-
-
- ..\packages\System.Security.Cryptography.X509Certificates.4.3.0\lib\net461\System.Security.Cryptography.X509Certificates.dll
-
-
- ..\packages\System.Net.Http.4.3.0\lib\net46\System.Net.Http.dll
-
-
- ..\packages\System.Xml.ReaderWriter.4.3.0\lib\net46\System.Xml.ReaderWriter.dll
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/TourVisualStudioForMac/vs4mac_dotnet_standard_library/.gitignore b/TourVisualStudioForMac/vs4mac_dotnet_standard_library/.gitignore
deleted file mode 100644
index 13d2fde..0000000
--- a/TourVisualStudioForMac/vs4mac_dotnet_standard_library/.gitignore
+++ /dev/null
@@ -1,40 +0,0 @@
-# Autosave files
-*~
-
-# build
-[Oo]bj/
-[Bb]in/
-packages/
-TestResults/
-
-# globs
-Makefile.in
-*.DS_Store
-*.sln.cache
-*.suo
-*.cache
-*.pidb
-*.userprefs
-*.usertasks
-config.log
-config.make
-config.status
-aclocal.m4
-install-sh
-autom4te.cache/
-*.user
-*.tar.gz
-tarballs/
-test-results/
-Thumbs.db
-
-# Mac bundle stuff
-*.dmg
-*.app
-
-# resharper
-*_Resharper.*
-*.Resharper
-
-# dotCover
-*.dotCover
diff --git a/TourVisualStudioForMac/vs4mac_dotnet_standard_library/vs4mac_dotnet_standard_library.dll b/TourVisualStudioForMac/vs4mac_dotnet_standard_library/vs4mac_dotnet_standard_library.dll
deleted file mode 100644
index 09cbcfb..0000000
Binary files a/TourVisualStudioForMac/vs4mac_dotnet_standard_library/vs4mac_dotnet_standard_library.dll and /dev/null differ
diff --git a/TourVisualStudioForMac/vs4mac_dotnet_standard_library/vs4mac_dotnet_standard_library.sln b/TourVisualStudioForMac/vs4mac_dotnet_standard_library/vs4mac_dotnet_standard_library.sln
deleted file mode 100644
index 01f32dc..0000000
--- a/TourVisualStudioForMac/vs4mac_dotnet_standard_library/vs4mac_dotnet_standard_library.sln
+++ /dev/null
@@ -1,17 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 2012
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "vs4mac_dotnet_standard_library", "vs4mac_dotnet_standard_library\vs4mac_dotnet_standard_library.csproj", "{7A55E168-AC52-4D7D-8212-B69D3C4CBEBC}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- Release|Any CPU = Release|Any CPU
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {7A55E168-AC52-4D7D-8212-B69D3C4CBEBC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {7A55E168-AC52-4D7D-8212-B69D3C4CBEBC}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {7A55E168-AC52-4D7D-8212-B69D3C4CBEBC}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {7A55E168-AC52-4D7D-8212-B69D3C4CBEBC}.Release|Any CPU.Build.0 = Release|Any CPU
- EndGlobalSection
-EndGlobal
diff --git a/TourVisualStudioForMac/vs4mac_dotnet_standard_library/vs4mac_dotnet_standard_library/Class1.cs b/TourVisualStudioForMac/vs4mac_dotnet_standard_library/vs4mac_dotnet_standard_library/Class1.cs
deleted file mode 100644
index c17ac7b..0000000
--- a/TourVisualStudioForMac/vs4mac_dotnet_standard_library/vs4mac_dotnet_standard_library/Class1.cs
+++ /dev/null
@@ -1,11 +0,0 @@
-namespace vs4mac_dotnet_standard_library
-{
- public static class Magicmatics
- {
- public static int GimmeRandomNumber()
- {
- return 4; // chosen by fair dice roll.
- // guaranteed to be random.
- }
- }
-}
diff --git a/TourVisualStudioForMac/vs4mac_dotnet_standard_library/vs4mac_dotnet_standard_library/vs4mac_dotnet_standard_library.csproj b/TourVisualStudioForMac/vs4mac_dotnet_standard_library/vs4mac_dotnet_standard_library/vs4mac_dotnet_standard_library.csproj
deleted file mode 100644
index b290d67..0000000
--- a/TourVisualStudioForMac/vs4mac_dotnet_standard_library/vs4mac_dotnet_standard_library/vs4mac_dotnet_standard_library.csproj
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
- netstandard1.4
-
-
-
diff --git a/TourVisualStudioForMac/vs4win_console1_netcore/vs4win_console1_netcore.sln b/TourVisualStudioForMac/vs4win_console1_netcore/vs4win_console1_netcore.sln
deleted file mode 100644
index 47f3c4b..0000000
--- a/TourVisualStudioForMac/vs4win_console1_netcore/vs4win_console1_netcore.sln
+++ /dev/null
@@ -1,22 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 15
-VisualStudioVersion = 15.0.26430.12
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "vs4win_console1_netcore", "vs4win_console1_netcore\vs4win_console1_netcore.csproj", "{843A2581-1FF2-4740-B824-D3D67409E42C}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- Release|Any CPU = Release|Any CPU
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {843A2581-1FF2-4740-B824-D3D67409E42C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {843A2581-1FF2-4740-B824-D3D67409E42C}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {843A2581-1FF2-4740-B824-D3D67409E42C}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {843A2581-1FF2-4740-B824-D3D67409E42C}.Release|Any CPU.Build.0 = Release|Any CPU
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
diff --git a/TourVisualStudioForMac/vs4win_console1_netcore/vs4win_console1_netcore/Program.cs b/TourVisualStudioForMac/vs4win_console1_netcore/vs4win_console1_netcore/Program.cs
deleted file mode 100644
index 7a8ce2f..0000000
--- a/TourVisualStudioForMac/vs4win_console1_netcore/vs4win_console1_netcore/Program.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-using System;
-
-namespace vs4win_console1_netcore
-{
- class Program
- {
- static void Main(string[] args)
- {
- Console.WriteLine("Hello World!");
- Console.WriteLine("\r\nPress any key to continue...");
- Console.ReadLine();
- }
- }
-}
\ No newline at end of file
diff --git a/TourVisualStudioForMac/vs4win_console1_netcore/vs4win_console1_netcore/vs4win_console1_netcore.csproj b/TourVisualStudioForMac/vs4win_console1_netcore/vs4win_console1_netcore/vs4win_console1_netcore.csproj
deleted file mode 100644
index 6d25f41..0000000
--- a/TourVisualStudioForMac/vs4win_console1_netcore/vs4win_console1_netcore/vs4win_console1_netcore.csproj
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Exe
- netcoreapp1.1
-
-
-
\ No newline at end of file
diff --git a/TourVisualStudioForMac/vs4win_console1_netframework/vs4win_console1_netframework.sln b/TourVisualStudioForMac/vs4win_console1_netframework/vs4win_console1_netframework.sln
deleted file mode 100644
index b55f6cb..0000000
--- a/TourVisualStudioForMac/vs4win_console1_netframework/vs4win_console1_netframework.sln
+++ /dev/null
@@ -1,22 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 15
-VisualStudioVersion = 15.0.26430.6
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "vs4win_console1_netframework", "vs4win_console1_netframework\vs4win_console1_netframework.csproj", "{E48F58FD-13C7-465C-8242-81AE3F68F003}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- Release|Any CPU = Release|Any CPU
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {E48F58FD-13C7-465C-8242-81AE3F68F003}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {E48F58FD-13C7-465C-8242-81AE3F68F003}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {E48F58FD-13C7-465C-8242-81AE3F68F003}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {E48F58FD-13C7-465C-8242-81AE3F68F003}.Release|Any CPU.Build.0 = Release|Any CPU
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
diff --git a/TourVisualStudioForMac/vs4win_console1_netframework/vs4win_console1_netframework/App.config b/TourVisualStudioForMac/vs4win_console1_netframework/vs4win_console1_netframework/App.config
deleted file mode 100644
index 88fa402..0000000
--- a/TourVisualStudioForMac/vs4win_console1_netframework/vs4win_console1_netframework/App.config
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/TourVisualStudioForMac/vs4win_console1_netframework/vs4win_console1_netframework/Program.cs b/TourVisualStudioForMac/vs4win_console1_netframework/vs4win_console1_netframework/Program.cs
deleted file mode 100644
index f81ce96..0000000
--- a/TourVisualStudioForMac/vs4win_console1_netframework/vs4win_console1_netframework/Program.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-using System;
-using vs4mac_dotnet_standard_library;
-
-namespace vs4win_console1_netframework
-{
- class Program
- {
- static void Main(string[] args)
- {
- var randomNumber = Magicmatics.GimmeRandomNumber();
-
- Console.WriteLine($"Hello World! Your random number is: {randomNumber}");
- Console.WriteLine("\r\nPress any key to continue...");
- Console.ReadLine();
- }
- }
-}
diff --git a/UsingAnnotationsToAssistReSharper/README.md b/UsingAnnotationsToAssistReSharper/README.md
deleted file mode 100644
index 23569a1..0000000
--- a/UsingAnnotationsToAssistReSharper/README.md
+++ /dev/null
@@ -1,3 +0,0 @@
-ReSharper / Annotations sample
-
-http://grantwinney.com/using-annotations-to-help-resharper-analyze-your-code/
\ No newline at end of file
diff --git a/UsingAnnotationsToAssistReSharper/UsingAnnotationsToAssistReSharper.sln b/UsingAnnotationsToAssistReSharper/UsingAnnotationsToAssistReSharper.sln
deleted file mode 100644
index 843adca..0000000
--- a/UsingAnnotationsToAssistReSharper/UsingAnnotationsToAssistReSharper.sln
+++ /dev/null
@@ -1,22 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 2013
-VisualStudioVersion = 12.0.31101.0
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UsingAnnotationsToAssistReSharper", "UsingAnnotationsToAssistReSharper\UsingAnnotationsToAssistReSharper.csproj", "{112D4EA9-AC3D-40CB-B9DF-857C9C48E6D9}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- Release|Any CPU = Release|Any CPU
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {112D4EA9-AC3D-40CB-B9DF-857C9C48E6D9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {112D4EA9-AC3D-40CB-B9DF-857C9C48E6D9}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {112D4EA9-AC3D-40CB-B9DF-857C9C48E6D9}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {112D4EA9-AC3D-40CB-B9DF-857C9C48E6D9}.Release|Any CPU.Build.0 = Release|Any CPU
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
diff --git a/UsingAnnotationsToAssistReSharper/UsingAnnotationsToAssistReSharper/Annotations.cs b/UsingAnnotationsToAssistReSharper/UsingAnnotationsToAssistReSharper/Annotations.cs
deleted file mode 100644
index e140973..0000000
--- a/UsingAnnotationsToAssistReSharper/UsingAnnotationsToAssistReSharper/Annotations.cs
+++ /dev/null
@@ -1,624 +0,0 @@
-using System;
-
-#pragma warning disable 1591
-// ReSharper disable UnusedMember.Global
-// ReSharper disable UnusedParameter.Local
-// ReSharper disable MemberCanBePrivate.Global
-// ReSharper disable UnusedAutoPropertyAccessor.Global
-// ReSharper disable IntroduceOptionalParameters.Global
-// ReSharper disable MemberCanBeProtected.Global
-// ReSharper disable InconsistentNaming
-
-namespace JetBrains.Annotations
-{
- ///
- /// Indicates that the value of the marked element could be null sometimes,
- /// so the check for null is necessary before its usage
- ///
- ///
- /// [CanBeNull] public object Test() { return null; }
- /// public void UseTest() {
- /// var p = Test();
- /// var s = p.ToString(); // Warning: Possible 'System.NullReferenceException'
- /// }
- ///
- [AttributeUsage(
- AttributeTargets.Method | AttributeTargets.Parameter |
- AttributeTargets.Property | AttributeTargets.Delegate |
- AttributeTargets.Field, AllowMultiple = false, Inherited = true)]
- public sealed class CanBeNullAttribute : Attribute { }
-
- ///
- /// Indicates that the value of the marked element could never be null
- ///
- ///
- /// [NotNull] public object Foo() {
- /// return null; // Warning: Possible 'null' assignment
- /// }
- ///
- [AttributeUsage(
- AttributeTargets.Method | AttributeTargets.Parameter |
- AttributeTargets.Property | AttributeTargets.Delegate |
- AttributeTargets.Field, AllowMultiple = false, Inherited = true)]
- public sealed class NotNullAttribute : Attribute { }
-
- ///
- /// Indicates that the marked method builds string by format pattern and (optional) arguments.
- /// Parameter, which contains format string, should be given in constructor. The format string
- /// should be in -like form
- ///
- ///
- /// [StringFormatMethod("message")]
- /// public void ShowError(string message, params object[] args) { /* do something */ }
- /// public void Foo() {
- /// ShowError("Failed: {0}"); // Warning: Non-existing argument in format string
- /// }
- ///
- [AttributeUsage(
- AttributeTargets.Constructor | AttributeTargets.Method,
- AllowMultiple = false, Inherited = true)]
- public sealed class StringFormatMethodAttribute : Attribute
- {
- ///
- /// Specifies which parameter of an annotated method should be treated as format-string
- ///
- public StringFormatMethodAttribute(string formatParameterName)
- {
- FormatParameterName = formatParameterName;
- }
-
- public string FormatParameterName { get; private set; }
- }
-
- ///
- /// Indicates that the function argument should be string literal and match one
- /// of the parameters of the caller function. For example, ReSharper annotates
- /// the parameter of
- ///
- ///
- /// public void Foo(string param) {
- /// if (param == null)
- /// throw new ArgumentNullException("par"); // Warning: Cannot resolve symbol
- /// }
- ///
- [AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false, Inherited = true)]
- public sealed class InvokerParameterNameAttribute : Attribute { }
-
- ///
- /// Indicates that the method is contained in a type that implements
- /// interface
- /// and this method is used to notify that some property value changed
- ///
- ///
- /// The method should be non-static and conform to one of the supported signatures:
- ///
- /// NotifyChanged(string)
- /// NotifyChanged(params string[])
- /// NotifyChanged{T}(Expression{Func{T}})
- /// NotifyChanged{T,U}(Expression{Func{T,U}})
- /// SetProperty{T}(ref T, T, string)
- ///
- ///
- ///
- /// public class Foo : INotifyPropertyChanged {
- /// public event PropertyChangedEventHandler PropertyChanged;
- /// [NotifyPropertyChangedInvocator]
- /// protected virtual void NotifyChanged(string propertyName) { ... }
- ///
- /// private string _name;
- /// public string Name {
- /// get { return _name; }
- /// set { _name = value; NotifyChanged("LastName"); /* Warning */ }
- /// }
- /// }
- ///
- /// Examples of generated notifications:
- ///
- /// NotifyChanged("Property")
- /// NotifyChanged(() => Property)
- /// NotifyChanged((VM x) => x.Property)
- /// SetProperty(ref myField, value, "Property")
- ///
- ///
- [AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = true)]
- public sealed class NotifyPropertyChangedInvocatorAttribute : Attribute
- {
- public NotifyPropertyChangedInvocatorAttribute() { }
- public NotifyPropertyChangedInvocatorAttribute(string parameterName)
- {
- ParameterName = parameterName;
- }
-
- public string ParameterName { get; private set; }
- }
-
- ///
- /// Describes dependency between method input and output
- ///
- ///
- ///