View git-audit-log
1 2 3 4 5 6 7 8
#!/bin/bash
#/ Usage: git audit-log <seek_offset>
set -e
 
[ -z "$GIT_DIR" ] && GIT_DIR=$(git rev-parse --git-dir)
audit_log="$GIT_DIR/audit_log"
# TODO: Acquire FLOCK
dd if=$audit_log bs=1 skip=$1 2>/dev/null
View analytics.diff
1 2 3 4 5 6 7 8 9 10
diff --git analytics.js analytics.js
index ea010f4..b4a045d 100644
--- a/analytics.js
+++ b/analytics.js
@@ -1001,14 +1001,6 @@
return a.hid = a.hid || hd()
};
var ad, bd = function(a, b, c) {
- if (!ad) {
- var d;
View gist:c2bb5b9548bc30d4a9df
1 2 3 4 5 6 7 8 9 10
public async IObservable<int> takeStream(IObservable<int> enum, int count)
{
int i = 0;
foreach (int x in enum)
{
Task<int> task = somethingAsync(x);
int y = await task;
yield y;
View observable-from-stream.js
1 2 3 4 5 6 7 8 9 10
// ES7 Observables + WHATWG Streams
//
// https://github.com/jhusain/asyncgenerator
// https://github.com/whatwg/streams
//
// Continuation from file:
// https://github.com/jhusain/asyncgenerator/blob/master/src/observable.js
 
Observable.fromStream = function(readable) {
return new Observable(function(generator) {
View anim.es6
1 2 3 4 5 6 7 8 9
async function chainAnimationsAsync(elem, animations) {
var ret = null;
try {
for (var anim in animations) {
ret = await anim(elem);
}
} catch(e) { /* ignore and keep going */ }
return ret;
}
View test_controller.rb
1 2 3 4 5 6 7 8 9 10
$ curl -I http://localhost:3000/test
HTTP/1.1 200 OK
Content-Type: text/html; charset=utf-8
 
$ curl -I -H 'Accept: text/html' http://localhost:3000/test
HTTP/1.1 200 OK
Content-Type: text/html; charset=utf-8
 
$ curl -I -H 'Accept: text/javascript' http://localhost:3000/test
HTTP/1.1 200 OK
View csp.rb
1 2 3 4 5 6 7 8 9 10
module GitHub
module CSP
# Public: Constants for CSP keywords
NONE = "'none'".freeze
SELF = "'self'".freeze
UNSAFE_INLINE = "'unsafe-inline'".freeze
UNSAFE_EVAL = "'unsafe-eval'".freeze
 
# Public: Constants for CSP directive names
BASE_URI = "base-uri".freeze
View emoji.coffee
1 2 3 4 5 6 7 8 9 10
# Native Emoji polyfill
#
# Backports native emoji characters to browsers that don't support
# them by replacing the characters with images.
#
# NOTE: Only content in "markdown-body" is rewritten.
 
# Custom emoji feature detect that passes in our old node/uglifier
# minifer. Maybe will fix that in the future.
#
View gist:11218565

"I think we're in this world I'd like to call Guard Rail Programming... 'I can make change because I have tests!' Who does that? Who drives their car around, banging against the guard rails? Do the guard rails help you get to where you want to go?" - Rich Hickey

http://www.infoq.com/presentations/Simple-Made-Easy

View await.js
1 2 3 4 5
function^ find() {
var id = await Promise.resolve(123);
var data = await findInMemoryOrDb(id);
return data;
}
Something went wrong with that request. Please try again.