Skip to content

Instantly share code, notes, and snippets.

@jen20
jen20 / gist:8930380
Created February 11, 2014 06:57
Binding double clicking a data grid to a ReactiveCommand
Observable.FromEventPattern<MouseButtonEventHandler, MouseButtonEventArgs>
(h => JobsGrid.MouseDoubleClick += h, h => JobsGrid.MouseDoubleClick -= h)
.InvokeCommand(this, v => v.ViewModel.GoToJob);
@jen20
jen20 / gist:9463288
Created March 10, 2014 11:19
Temporary build instructions for Event Store on OS X. Not complete or tested.
Note that this will ONLY work currently (10 March 2014) with the `dev` branch of Event Store as that has commits which fix the .csproj files to use dylibs instead of shared objects. Instructions are incomplete and untested, but there will be a working, tested script forthcoming soon!
1. Build a 64 bit mono from source (I'm on 3.8, the GC is broken in everything since 3.0.12 though (and that needs patching) but I guess if you're on OS X you're not talking production here). Assuming this is going in /opt/mono
2. Clone and build V8. Should be a simple case of:
- `make dependencies`
- `make x64.release library=shared`
- Copy the dylibs to `src/EventStore/libs/`
@jen20
jen20 / output
Last active August 29, 2015 13:57
~/Code  locate mscorlib.dll
/Users/James/Code/mono-3.2.8/mcs/class/lib/basic/mscorlib.dll
/Users/James/Code/mono-3.2.8/mcs/class/lib/basic/tmp/mscorlib.dll
/Users/James/Code/mono-3.2.8/mcs/class/lib/build/mscorlib.dll
/Users/James/Code/mono-3.2.8/mcs/class/lib/build/tmp/mscorlib.dll
/Users/James/Code/mono-3.2.8/mcs/class/lib/monolite/mscorlib.dll
/Users/James/Code/mono-3.2.8/mcs/class/lib/net_2_0/mscorlib.dll
/Users/James/Code/mono-3.2.8/mcs/class/lib/net_2_0/mscorlib.dll.mdb
/Users/James/Code/mono-3.2.8/mcs/class/lib/net_2_0/tmp/mscorlib.dll
/Users/James/Code/mono-3.2.8/mcs/class/lib/net_4_0/mscorlib.dll
var connSettings = ConnectionSettings.Create()
.DisableVerboseLogging()
.PerformOnMasterOnly()
.LimitConcurrentOperationsTo(500)
.LimitOperationsQueueTo(5000)
.KeepReconnecting()
.WithConnectionTimeoutOf(TimeSpan.FromMilliseconds(500))
.SetReconnectionDelayTo(TimeSpan.Zero);
var clusterSettings = ClusterSettings.Create()
export BOXEN_SRC_DIR=~/Code
ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future script/boxen
class people::jen20 {
boxen::osx_defaults {
"NormalFunctionKeys":
ensure => present,
domain => 'NSGlobalDomain',
key => "com.apple.keyboard.fnState",
type => 'boolean',
value => 'true';
"NoPressAndHold":
ensure => present,
set -g default-terminal "xterm-256color"
unbind C-b
set -g prefix C-a
bind C-a send-prefix
@jen20
jen20 / run.sh
Last active August 29, 2015 13:59
UUIDS benchmark
$ ./uuids
Completed test with libuuid:
Iterations: 10,000,000
Duration: 786.47ms (786,467,499ns)
Completed test with libuuid:
Iterations: 10,000,000
Duration: 723.36ms (723,363,115ns)
Completed test with libuuid:
Iterations: 10,000,000
Duration: 742.35ms (742,345,965ns)
@jen20
jen20 / pin-vs.ps1
Created April 25, 2014 13:55
Pin Visual Studio to the task bar via Powershell
$shell = new-object -com "Shell.Application"
$dir = $shell.Namespace("C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE")
$item = $dir.ParseName("devenv.exe")
$item.InvokeVerb('taskbarpin')
As of commit 3b32dfd9e03940ac1b6e6a79a5f27fef79a54182
Warnings:
/Users/James/Code/EventStore/src/EventStore/EventStore.sln (default targets) ->
(Build target) ->
/Users/James/Code/EventStore/src/EventStore/EventStore.Projections.Core.Tests/EventStore.Projections.Core.Tests.csproj (default targets) ->
/opt/mono-e1d0655a/lib/mono/4.5/Microsoft.CSharp.targets (CoreCompile target) ->
Services/checkpoint_tag/checkpoint_tag_by_stream_positions.cs(51,66): warning CS0219: The variable `r' is assigned but its value is never used