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
| #!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
| 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
| 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
| 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
| (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
| [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
| 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
| 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 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
| 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 |