A Pen by francesco agati on CodePen.
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
Bacon = Native `Bacon` | |
class ProxyStream | |
def initialize(wrapped) | |
@wrapped = wrapped | |
end | |
def method_missing(method,*args) |
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 | |
$app = new Slim\Slim(); | |
$app->get('/hello/:name', function ($name) { | |
echo('Hello' . $name); | |
}); | |
$app->run(); |
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
meta = (context,fn) -> | |
def = | |
accessors: (names...) -> @accessor(name) for name in names | |
accessor: (name) -> | |
context["get_#{name}"] = -> @[name] | |
context["set_#{name}"] = (v) -> @[name] = v | |
fn(def) | |
class Pippa |
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
express = require("express") | |
Bacon = require("baconjs") | |
app = express() | |
route = (app) -> (path) -> | |
bus = new Bacon.Bus() | |
app.get path, (req,res) -> | |
bus.push | |
req: -> req |
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
$(document).ready -> | |
wait = (n) -> (next) -> setTimeout (-> next(null) ), n | |
waitFor = (fn) -> (next) -> fn(next) | |
moveGenerator = | |
(action) -> | |
(selector,args...) -> |
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 bash | |
# login as root and run this script via bash & curl: | |
apt-get update | |
apt-get install -y build-essential bison openssl libreadline5 libreadline5-dev curl \ | |
git-core zlib1g zlib1g-dev libopenssl-ruby libcurl4-openssl-dev libssl-dev \ | |
libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libmysqlclient-dev \ | |
mysql-client mysql-server |
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
require 'benchmark' | |
array = (1..100000).map { rand } | |
Benchmark.bmbm do |x| | |
x.report("sort!") { (0..20).each { array.dup.sort! } } | |
x.report("sort") { (0..20).each { array.dup.sort! } } | |
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
require 'benchmark' | |
require 'parallel' | |
array = (1..100000).map { rand } | |
Benchmark.bmbm do |x| | |
x.report("sort!") { Parallel.map((0..20), :in_process=>8) { array.dup.sort! } } | |
x.report("sort") { Parallel.map((0..20), :in_process=>8) { array.dup.sort! } } | |
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
import com.dongxiguo.continuation.Continuation; | |
@:build(com.dongxiguo.continuation.Continuation.cpsByMeta("cps")) | |
class Sample | |
{ | |
static function delay(n:Dynamic,handler:Dynamic->Dynamic):Void { | |
var fn=function() { | |
handler(n); |