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> | |
/// Convert to ISO 8601 Date time format (Required by Sqlite) | |
/// </summary> | |
/// <param name="dateTime">date to convert</param> | |
/// <returns>date converted to ISO8601 datetime format</returns> | |
public static string ToISO8601(this DateTime dateTime) | |
{ | |
return dateTime.ToString("u").Replace("Z", ""); | |
} |
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
// OK, WTF is with ALL of these damn usings that are NOT EVEN USED. IMPORT ALL THE THINGS! | |
using System; | |
using System.Net; | |
using System.Windows; | |
using System.Windows.Controls; | |
using System.Windows.Documents; | |
using System.Windows.Ink; | |
using System.Windows.Input; | |
using System.Windows.Media; |
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
namespace MyCompany.Data | |
{ | |
internal class StoredProcedureManager | |
{ | |
public static string GetStoredProcedureName(StoredProcedure storedProcedure) | |
{ | |
switch (storedProcedure) | |
{ | |
case StoredProcedure.GetAllDataByUser: | |
return "GetClientAccountsByUser"; |
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
Gravity Kata | |
Create a system that shows how stacked ice blocks behave with gravity. | |
Here are some examples of how the ice blocks behave in this system: | |
Adding blocks | |
Before After | |
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 DirectoryInfo GetDestinationFor(string fileName) | |
{ | |
Log.InfoFormat("Getting destination for {0}", fileName); | |
var result = paths.FirstOrDefault(x => x.Key.IsMatch(fileName)); | |
if (result.Key != null) | |
{ | |
Log.InfoFormat("Destination for {0} is {1}", fileName, result.Value); | |
return result.Value; | |
} |
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
<appSettings> | |
<add key="myDevMachineName" value="Dev" /> | |
<add key="myTestMachineName" value="Test" /> | |
<add key="myUATMachineName" value="UAT" /> | |
<add key="myProdMachineName" value="Prod" /> | |
<add key="Dev.Foo" value="Bar" /> | |
<add key="Test.Foo" value="Baz" /> | |
<add key="UAT.Foo" value="Bin" /> | |
<add key="Prod.Foo" value="BarkBark!" /> |
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; | |
namespace TuplesSuck | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
var returnedCount = 0; | |
var returnedString = ""; |
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
Imports Xunit | |
Imports System.Linq | |
Imports System.Dynamic | |
Imports Simple.Data.Mocking | |
Public Class Mockz | |
<Fact()> | |
Public Sub MockMockMock() | |
Dim mockAdapter As New XmlMockAdapter(<Root> | |
<Cats Age="System.Int32"> |
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
Imports System.Dynamic | |
Module SimpleVBDataCatz | |
Sub Main() | |
Console.WriteLine("Let's see some of this Simple.Data magick in VB") | |
Dim db = Database.Opener.OpenFile("Data\ICanHazData.sdf") | |
InsertTimmyCatAsAnonymousObject(db) |
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 DateTimeExtensions | |
{ | |
public static DateTime LastFridayOfMonth(this DateTime value) | |
{ | |
var days = Enumerable.Range(1, DateTime.DaysInMonth(value.Year, value.Month)); | |
var dates = days.Select(day => new DateTime(value.Year, value.Month, day)); | |
var lastFriday = dates.OrderBy(day => day).Last(day => day.DayOfWeek == DayOfWeek.Friday); |