$ git init mystore
$ cd mystore
$ git store set foo "this is foo"
$ git store get foo
this is foo
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
(defn debounce [in ms] | |
(let [out (chan)] | |
(go-loop [last-val nil] | |
(let [val (if (nil? last-val) (<! in) last-val) | |
timer (timeout ms) | |
[new-val ch] (alts! [in timer])] | |
(condp = ch | |
timer (do (>! out val) (recur nil)) | |
in (recur new-val)))) | |
out)) |
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
// node --harmony example.js | |
var go = require('./go'); | |
var even = go.channel(); | |
var odd = go.channel(); | |
go(function* () { | |
for (var i = 0; i < 10; i += 2) { | |
yield even.put(i); |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.js"></script> | |
<script src="http://underscorejs.org/underscore.js"></script> | |
<script src="http://backbonejs.org/backbone.js"></script> | |
<script src="wings.js"></script> | |
<script> |
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
package main | |
import ( | |
"bufio" | |
"flag" | |
"fmt" | |
"net" | |
"strconv" | |
"strings" | |
"time" |
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
alias redis-start="launchctl start io.redis.redis-server" | |
alias redis-stop="launchctl stop io.redis.redis-server" | |
alias redis-status="launchctl list | grep io.redis.redis-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
// Include { env: 'development' } in your RequireJS config | |
// When building (with r.js) set the value to 'production' or just omit it entirely | |
// | |
// Assuming the following directory structure: | |
// - config/ | |
// - development.js | |
// - production.js | |
// | |
// Load the appropriate file based on the current env: | |
// |
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
<snippet> | |
<content><![CDATA[return ${1:callback} ${2:err} if ${2:err}?]]></content> | |
<tabTrigger>ifer</tabTrigger> | |
<scope>source.coffee</scope> | |
<description>ifer</description> | |
</snippet> |
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
var express = require('express'); | |
var im = require('imagemagick'); | |
var nettle = require('nettle'); | |
var app = express.createServer(); | |
var store = nettle.store({ url: 'mongodb://localhost:27017/mydb' }); | |
// Create Nettle processor to resize image | |
var createProcessor = function(width) { | |
store.processor(width, function(buffer, callback) { |