Because Chrome DevTools snippets don't get saved...boo
also, for good reference: http://anti-code.com/devtools-cheatsheet/
| using System; | |
| namespace ch.cimnine.Util | |
| { | |
| public sealed class Numeric | |
| { | |
| /// <summary> | |
| /// Determines if a type is numeric. Nullable numeric types are considered numeric. | |
| /// </summary> | |
| /// <remarks> |
| ## Install the .NET Upgrade Assistant | |
| dotnet tool install -g upgrade-assistant | |
| ## Update the .NET Upgrade Assistant | |
| dotnet tool update -g upgrade-assistant | |
| ## Uninstall the .NET Upgrade Assistant | |
| dotnet tool uninstall -g upgrade-assistant | |
| ## Analyze |
| using System; | |
| using System.Collections.Generic; | |
| namespace ZipMany | |
| { | |
| /// <summary> | |
| /// Zip multiple arrays (more than 2 since there is a built in Zip for 2 with .Net 4.0) | |
| /// </summary> | |
| public static class ZipMultiple | |
| { |
| using System.Xml; | |
| using System.Xml.Linq; | |
| namespace XmlLib | |
| { | |
| /// <summary> | |
| /// Provides extension methods for simple conversion between System.Xml and System.Xml.Linq classes. | |
| /// </summary> | |
| /// <remarks>From: http://brianary.blogspot.com/2010/02/converting-between-xdocument-and.html</remarks> | |
| public static class XmlLinqConversionExtensions |
| public class ObservableValue<T> : INotifyPropertyChanged | |
| { | |
| public class MyArgs : PropertyChangedEventArgs | |
| { | |
| public MyArgs(string propertyName, T old, T @new) | |
| : base(propertyName) | |
| { | |
| Old = old; | |
| New = @new; | |
| } |
| // Includes a mini-program for checking and fixing files that have no extension | |
| // Only checks for the most common types | |
| // If you create a better version, please upload it here. | |
| using System; | |
| using System.Collections.Generic; | |
| using System.IO; | |
| namespace AppendJPG | |
| { |
| set -x | |
| set -e | |
| # e.g. folder to process e.g. "frontend/" | |
| migration_folder=$1 | |
| find_regex=".*/*.tsx?" # mach all .ts and .tsx files | |
| # include trailing path "/" in folder parameter: e.g "frontend/" instead of just "frontend" | |
| ignore_path="*/$1node_modules/*" | |
| # Back up your files or change sed argument -i to -i.bak to generate backup files | |
| find $migration_folder -regextype posix-egrep -regex $find_regex -type f -not -path $ignore_path | xargs sed -i -E '/[(class)(")]/{ | |
| s/([mp])l(-[0-5])/\1s\2/g |
| public class JobInfoRepository : IDisposable | |
| { | |
| private readonly IDisposable _cleanUp; | |
| public IObservableCache<JobInfo, int> Results { get; } | |
| public JobInfoRepository() | |
| { | |
| var readWriteCache = new SourceCache<JobInfo, int>(ji => ji.JobID); | |
| Results = readWriteCache.AsObservableCache(); |
| public static class SqlObservations | |
| { | |
| public static IObservable<IEnumerable<IDataRecord>> MonitorChanges(string connectionString, string sql) | |
| { | |
| /* | |
| 1. read data from database and return results | |
| 2. monitor changes | |
| 3. when there is a change, repeat the whole process | |
| */ |
Because Chrome DevTools snippets don't get saved...boo
also, for good reference: http://anti-code.com/devtools-cheatsheet/