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
#!/bin/bash | |
set -e | |
show_help() { | |
cat << EOF | |
Usage: ${0##*/} [-u USER] [-p PASS] [-P PORT] [-H HOST] [DATABASE] | |
${0##*/} -h | |
Open a standard connection in Sequel PRO. |
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
xbuild build.proj /target:Test /property:Configuration="Debug 4.0";Platform="Any CPU" | |
xbuild build.proj /target:Build /property:Configuration="Debug 4.0";Platform="Any CPU" | |
xbuild build.proj /target:Dist /property:Configuration="Debug 4.0";Platform="Any CPU" | |
xbuild build.proj /target:Test /property:Configuration="Release 4.0";Platform="Any CPU" | |
xbuild build.proj /target:Build /property:Configuration="Release 4.0";Platform="Any CPU" |
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
namespace FilesTypeProvider | |
open System.Reflection | |
open Microsoft.FSharp.Core.CompilerServices | |
open Samples.FSharpPreviewRelease2011.ProvidedTypes | |
open System.Text.RegularExpressions | |
[<TypeProvider>] | |
type public CheckedFilesProvider() as this = |
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
#!/usr/bin/env python | |
# coding: utf-8 | |
""" | |
Python web handler test | |
~~~~~~~~~~~~~~~~~~~~~~~ | |
Detect web handler: mod_wsgi, fast_CGI, mod_python or CGI and display many informations | |
You should check if the shebang is ok for your environment! |
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 geventwebsocket.handler import WebSocketHandler | |
from gevent.pywsgi import WSGIServer | |
from flask import Flask, request, render_template | |
app = Flask(__name__) | |
@app.route('/') | |
def index(): | |
return render_template('index.html') |
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
<?php | |
namespace CHH; | |
trait MetaObject | |
{ | |
protected static $__metaClass; | |
static function setMetaClass(MetaClass $metaClass) | |
{ |
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
type 'a Outcome = { | |
Value: 'a | |
Probability : BigRational } | |
type 'a Distribution = 'a Outcome seq | |
// P(A AND B) = P(A | B) * P(B) | |
let bindD (dist:'a Distribution) (f: 'a -> 'b Distribution) = | |
dist | |
|> Seq.map (fun p1 -> |
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 ComMonad | |
//type ComOp<'T> = (unit -> 'T) | |
let private runCom t = t() | |
type Com = | |
static member Run t = runCom t | |
let private result t = (fun () -> t) | |
let private delay (f:unit->unit->'a) = (fun() -> f()()) |
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
// Example of using F# MailboxProcessor against an HTML5 WebSocket (in Google Chrome) | |
// taken from http://v2matveev.blogspot.com/2010/04/mailboxprocessors-practical-application.html | |
// and then modified to work with the revised WebSocket protocol that includes a set of challenge bytes. | |
// The main changes are in the handshake function. | |
// Have a look at the http://nugget.codeplex.com for example WebSocket code in C#, on which I based the | |
// challenge processing code. | |
open System | |
open System.IO | |
open System.Linq |
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
foo_module = IronRuby.require 'foo' | |
foo_module.Foo.new.bar |
NewerOlder