This file contains hidden or 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
from hamlish_jinja import HamlishTagExtension | |
from jinja2.environment import load_extensions | |
def enable_haml(page): | |
env = page.__class__.tmpl_env | |
env.extensions = load_extensions(env, [HamlishTagExtension]) | |
hooks = { | |
'page.meta.pre': [enable_haml] | |
} |
This file contains hidden or 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
[color] | |
ui = true | |
[format] | |
pretty = oneline | |
[core] | |
autocrlf = true | |
[alias] | |
# basic stuff | |
st = status -s | |
s = status -s |
This file contains hidden or 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
(fun x -> printfn "%s @%A" x <| x.Replace("\"", "\"\"")) @"(fun x -> printfn ""%s @%A"" x <| x.Replace(""\"""", ""\""\""""))" |
This file contains hidden or 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
Windows Registry Editor Version 5.00 | |
[HKEY_CURRENT_USER\Control Panel\Desktop\WindowMetrics] | |
"PaddedBorderWidth"="0" |
This file contains hidden or 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
echo "Restarting Wi-Fi adapter..." | |
$a = get-wmiobject -class Win32_NetworkAdapter | Where-Object {$_.Name -like "*6205*"} | |
echo "Disabling..." | |
$a.Disable() | |
sleep 1 | |
echo "Enabling..." |
This file contains hidden or 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
scala> def withList[T](x: List[T]) = x match { case Seq(1, 2, 3) => 1 } | |
withList: [T](x: List[T])Int | |
scala> withList(List(1, 2, 3)) | |
res6: Int = 1 | |
scala> withList(Seq(1, 2, 3)) | |
<console>:9: error: type mismatch; | |
found : Seq[Int] | |
required: List[?] |
This file contains hidden or 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
#!python | |
'''Haskell lint script for Emacs. | |
Translated from this: https://gist.github.com/1241073 | |
''' | |
from __future__ import print_function | |
import sys | |
import subprocess | |
import re |
This file contains hidden or 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
private void Form1_Load(object sender, EventArgs e) | |
{ | |
// get an observable for mouse move event | |
var mouseMove = Observable.FromEventPattern<MouseEventHandler, MouseEventArgs>( | |
x => this.MouseMove += x, x => this.MouseMove -= x); | |
// our rectangle | |
var rect = new Rectangle(50, 50, 50, 50); | |
// create event stream transformation |
This file contains hidden or 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
// This operator is used in the slides for this talk: http://fwaris.wordpress.com/2013/01/31/unraveling-the-mystery-of-monads/ | |
// I haven't seen all the slides yet but I took a shot on implementing it myself. | |
let (<||>) a b = async { | |
let! a = Async.StartChild a | |
let! b = Async.StartChild b | |
let! ar = a | |
let! br = b | |
This file contains hidden or 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
type SomethingViewModel() as this = | |
inherit ViewModelBase() | |
let (<<+) (_ : unit) (e : Microsoft.FSharp.Quotations.Expr) = | |
this.OnPropertyChanged e | |
let mutable somePropertyValue = "" | |
member x.SomeProperty | |
with get() = somePropertyValue | |
and set value = (somePropertyValue <- value) <<+ <@ x.SomeProperty @> |