Skip to content

Instantly share code, notes, and snippets.

View zaach's full-sized avatar
🎯
Focusing

Zach Carter zaach

🎯
Focusing
View GitHub Profile
@igorw
igorw / turel.clj
Last active August 29, 2015 13:57
(ns turel.core
(:refer-clojure :exclude [==])
(:use clojure.core.logic))
(defn not-membero
[x l]
(conde [(emptyo l)]
[(fresh [head tail]
(conso head tail l)
(!= head x)
@cowboy
cowboy / super-shrinkify.js
Created August 7, 2010 18:51
Super Shrinkify
// This might be useful for certain size-limited JS competitions, or not. #js
function super_shrinkify( str ){
if ( str.length % 2 ) {
str += ' ';
}
var prefix = '"',
suffix = '".replace(/./g,function(a){a=a.charCodeAt();return String.fromCharCode(a>>7,a%128)})',
str_bytes = unescape( encodeURIComponent( str ) ).length,
@alunny
alunny / description.md
Created November 26, 2010 22:22
my git configuration

My Git Configuration

For best results, use hub and git bash completion (included with git under contrib/completion).

// new node.js tls api
var tls = require('tls');
var fs = require('fs');
var options = {
key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'),
cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem')
};
var server = tls.createServer(options, function (s) {
@guybrush
guybrush / nodeconf_2011.md
Created May 6, 2011 07:22
a list of slides from nodeconf 2011
@jed
jed / LICENSE.txt
Created May 16, 2011 18:53 — forked from 140bytes/LICENSE.txt
scope
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Jed Schmidt <http://jed.is>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@tlrobinson
tlrobinson / test.js
Created June 19, 2011 05:52
Implementations of parallel and serial "map" function for Q lib
function mapParallel(array, callback) {
return array.reduce(function(acc_p, element, index, array) {
return Q.when(callback(element, index, array), function(res) {
return Q.when(acc_p, function(acc) {
return acc.concat([res]);
});
});
}, []);
}
@tlrobinson
tlrobinson / Makefile
Created June 25, 2011 03:31
Remote Makefiles fun
MAKEFILE=$(lastword $(MAKEFILE_LIST))
REMOTE?=$(REMOTE_USER)@$(REMOTE_HOST)
REMOTE_SSH?=ssh -p $(REMOTE_PORT)
REMOTE_SHELL?=$(REMOTE_SSH) $(REMOTE) $(REMOTE_LOGIN)
REMOTE_MAKE?=cat $(MAKEFILE) | $(REMOTE_SHELL) make -f /dev/stdin -C $(REMOTE_BASE)
# LOCAL COMMANDS:
hello:
@swannodette
swannodette / gist:1667847
Created January 24, 2012 04:40
hierarchy.clj
(ns hierarchy.core
(:refer-clojure :exclude [==])
(:use [clojure.core.logic]))
(def order [:domain :kingdom :phylum :class :order :family :genus :species])
(def homo-sapiens
{:domain :eukarya
:kingdom :animalia-metazoa
:phylum :chordata
function loadScript(url, callback) {
var script = document.body.appendChild(document.createElement("script"));
script.onload = callback;
script.src = url;
}
function loadScripts(scripts, callback) {
dependencies.reverse().reduce(function(next, url) {
return loadScript.bind(null, url, next);
}, callback)();
}