This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Linq; | |
using System.Xml.Linq; | |
namespace OpmlStats.ConsoleApp | |
{ | |
class Program | |
{ | |
private const string OpmlFile = @"C:\Path\To\Your\OpmlFile.opml"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<CodeSnippets | |
xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet"> | |
<CodeSnippet Format="1.0.0"> | |
<Header> | |
<Title>AnyKeyQuit</Title> | |
<Author>Jon Sagara</Author> | |
<Description>Inserts a "Press any key to quit..." prompt</Description> | |
<Shortcut>quit</Shortcut> | |
</Header> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Sample struct that shows how to override GetHashCode and Equals, as well as the == and != | |
/// operators. | |
/// </summary> | |
/// <remarks> | |
/// This type is immutable. | |
/// </remarks> | |
public struct SampleStruct | |
{ | |
#region Private Backing Fields |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ------------------------------------------------------------------------------------------------- | |
# Pinger.ps1 | |
# | |
# Repeatedly pings the specified server until the ping is successful. | |
# ------------------------------------------------------------------------------------------------- | |
# Script params | |
param([String]$server) | |
# Script param validation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class SystemTime | |
{ | |
public static Func<DateTime> Now = () => DateTime.Now; | |
public static Func<DateTime> UtcNow = () => DateTime.UtcNow; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using Lucene.Net.Analysis; | |
using Lucene.Net.Analysis.Standard; | |
using Lucene.Net.Documents; | |
using Lucene.Net.Index; | |
using Lucene.Net.QueryParsers; | |
using Lucene.Net.Search; | |
using Lucene.Net.Store; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Checks to see if source is in the items collection. | |
/// </summary> | |
/// <typeparam name="T"></typeparam> | |
/// <param name="source"></param> | |
/// <param name="items"></param> | |
/// <returns></returns> | |
public static bool In<T>(this T source, params T[] items) | |
{ | |
if (items == null) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class LinqExtensions | |
{ | |
public static IOrderedQueryable<TSource> OrderBy<TSource, TKey>(this IQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, bool isAscending) | |
{ | |
return isAscending | |
? source.OrderBy(keySelector) | |
: source.OrderByDescending(keySelector); | |
} | |
public static IOrderedQueryable<TSource> ThenBy<TSource, TKey>(this IOrderedQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, bool isAscending) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var hexNum = "0x000000000000E295"; | |
long result; | |
long.TryParse( | |
hexNum.Substring(2), | |
System.Globalization.NumberStyles.HexNumber | System.Globalization.NumberStyles.AllowHexSpecifier, | |
System.Globalization.CultureInfo.CurrentCulture, | |
out result | |
); | |
//result.Dump(); | |
var resultBytes = BitConverter.GetBytes(result); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Program | |
{ | |
private const string SourceDirectory = @"D:\iPhoneMedia"; | |
private const string DestDirectory = @"D:\iPhoneMediaSorted"; | |
static void Main(string[] args) | |
{ | |
var sourceDir = new DirectoryInfo(SourceDirectory); | |
// Group by YYYYMM |
OlderNewer