Skip to content

Instantly share code, notes, and snippets.

View JakeGinnivan's full-sized avatar
:shipit:

Jake Ginnivan JakeGinnivan

:shipit:
View GitHub Profile
@JakeGinnivan
JakeGinnivan / The Plan.md
Last active August 29, 2015 14:23
The Bermondsey Beer Mile
  • 12pm - The Kernel (~1hour) (2pm close)
  • 1pm - Fourpure (~45mins)
  • 1:30pm - Partizan (~45hour)
  • 2:30pm - Brew By Numbers (~1hour)
  • 3:30pm - Southwark Brewing Co (~30mins) (5pm close)
  • 4:15pm - Anspach & Hobday/Bullfinch Brewery (~1hour) (6pm close)
  • 6pm - Bottleshop

Map of where they all are

void Main()
{
var configurationStore = new ConfigurationStore(new TypeMapFactory(), MapperRegistry.Mappers);
var mapper = new MappingEngine(configurationStore);
var server = new Server();
configurationStore
.CreateMap<From, To>()
.ForMember(d => d.ServerThing, m => m.ResolveUsing(new FromServer1Resolver(server)).FromMember(s => s.ServerThingId))
@JakeGinnivan
JakeGinnivan / WithLatestFrom.cs
Last active August 29, 2015 14:19
WithLatestFrom
void Main()
{
var stream1 = Observable.Interval(TimeSpan.FromSeconds(5)).Select(_ => "a" + _);
var stream2 = Observable.Interval(TimeSpan.FromSeconds(1)).Select(_ => "b" + _);
stream1.WithLatestFrom(stream2, (a, b) => new {a, b}).DumpLatest(true);
}
public static class ObservableExtensions
{
@JakeGinnivan
JakeGinnivan / Profile.ps1
Created August 14, 2014 13:29
Profile.ps1
cd c:\
# Load posh-git example profile
. 'C:\_code\posh-git-master\profile.example.ps1'
function Get-Batchfile ($file) {
$cmd = "`"$file`" & set"
cmd /c $cmd | Foreach-Object {
$p, $v = $_.split('=')
Set-Item -path env:$p -value $v
}
public class Proto
{
public bool MyFlag { get; set; }
public bool HasMyFlag { get; set; }
}
public class Dto
{
public bool? MyFlag { get; set; }
}
public sealed class ArrayEqualityComparer<T> : IEqualityComparer<T[]>
{
// You could make this a per-instance field with a constructor parameter
private static readonly EqualityComparer<T> ElementComparer
= EqualityComparer<T>.Default;
public bool Equals(T[] first, T[] second)
{
if (first == second)
{
function Prune-Local-Branches() {
git branch --merged master | grep -v 'master$' | xargs git branch -d
}
[alias]
a = add -A
abort = rebase --abort
amend = commit --amend -C HEAD
bl = blame -w -M -C
br = branch
cat = cat-file -t
ci = commit -a
co = checkout
df = diff --word-diff=color --word-diff-regex=. -w --patience
@JakeGinnivan
JakeGinnivan / gist:0aae81e58e90b891bfef
Created May 14, 2014 16:10
Unknown mergetool issue
git config option merge.tool set to unknown tool: --global
Resetting to default...
This message is displayed because 'merge.tool' is not configured.
See 'git mergetool --tool-help' or 'git help config' for more details.
'git mergetool' will now attempt to use one of the following tools:
tortoisemerge emerge vimdiff
No known merge tool is available.
void Main()
{
this.Given(_ => TheBuyerIsA(_buyerCategory))
.And(_ => TheBuyerSelectsA(fare))
.When(_ => TheBuyerPays())
.Then(_ => ASaleOccursWithAnAmountOf(Price))
.WithExamples(new ExampleTable(
"Buyer Category", "Fare", "Price")
{
{ BuyerCategory.Student, new MonthlyPass(), new Currency(76) },