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
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 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 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 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 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 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 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 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
open System.IO | |
open System.Net | |
let wc = new WebClient() | |
let trainingSetFile = Path.Combine( __SOURCE_DIRECTORY__, "trainingSet.csv") | |
File.WriteAllText(trainingSetFile, | |
contents = wc.DownloadString("http://brandewinder.blob.core.windows.net/public/trainingsample.csv") | |
) |
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
module Jekyll | |
class MarkdownBlock < Liquid::Block | |
def initialize(tag_name, text, tokens) | |
super | |
end | |
require "kramdown" | |
def render(context) | |
content = super | |
"#{Kramdown::Document.new(content).to_html}" | |
end |
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
@echo off | |
"C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\sn.exe" -q -vf "%1" > NUL | |
if ERRORLEVEL 1 goto NOT_SIGNED | |
:SIGNED | |
echo Already signed: %~nx1 | |
goto END | |
:NOT_SIGNED |