Skip to content

Instantly share code, notes, and snippets.

View zaach's full-sized avatar
🎯
Focusing

Zach Carter zaach

🎯
Focusing
View GitHub Profile
#!/bin/bash
# from here: http://www.codingsteps.com/install-redis-2-6-on-amazon-ec2-linux-ami-or-centos/
# and here: https://raw.github.com/gist/257849/9f1e627e0b7dbe68882fa2b7bdb1b2b263522004/redis-server
###############################################
# To use:
# wget https://gist.github.com/tammomueller/5769498/raw/7a1a21c6c437484c07d45147faad5f7ad480e6e2/install-redis.sh
# chmod 777 install-redis.sh
# ./install-redis.sh
###############################################
echo "*****************************************"
@zaach
zaach / gist:3795452
Created September 27, 2012 18:04 — forked from jedp/gist:3778932
B2G repo setup and build quickstart

B2G Quickstart for Payments and Identity

This sets you up to make two separate targets:

  • One for a desktop [simulator] [1]
  • One for the ZTE [device] [2]

These are the moving parts:

  • [mozilla-inbound repo] [3] clone (hg)
  • [gaia repo] [4] fork (git)
  • [B2G project clone] [5] (git)
#
# Cookbook Name:: nodejs
# Recipe:: default
#
if ['solo'].include?(node[:instance_role])
nodejs_file = "node-v0.1.101.tar.gz"
nodejs_dir = "node-v0.1.101"
nodejs_url = "http://nodejs.org/dist/#{nodejs_file}"
.mouse{
position: absolute;
background-image: url('../images/cursor.png');
width: 15px;
height: 22px;
z-index: 100;
}
var HTTPParser = process.binding('http_parser').HTTPParser;
var net = require('net');
var path = require('path');
var sys = require('sys');
var Worker = require('webworker/webworker').Worker;
var VHOSTS = ['foo.bar.com', 'baz.bizzle.com'];
var WORKERS = {};
VHOSTS.forEach(function(vh) {
@zaach
zaach / def.js
Created July 14, 2010 03:42 — forked from tobitailor/def.js
/*
* def.js: Simple Ruby-style inheritance for JavaScript
*
* Copyright (c) 2010 Tobias Schneider
* This script is freely distributable under the terms of the MIT license.
*
*
* Example:
*
* def ("Person") ({
/*
* Copyright (c) 2010 Tobias Schneider
* This script is freely distributable under the terms of the MIT license.
*/
(function(){
var UPC_SET = {
"3211": '0',
"2221": '1',
"2122": '2',
var JAKE = require("jake");
var FILE = require("file");
var narcissusPath = FILE.path(require("packages").catalog.narcissus.directory);
JAKE.task("default", function() {
var script = exports.bundle([
{ id : "narcissus/defs", path : narcissusPath.join("lib", "narcissus", "defs.js") },
{ id : "narcissus/parse", path : narcissusPath.join("lib", "narcissus", "parse.js") },
{ id : "narcissus/format", path : narcissusPath.join("lib", "narcissus", "format.js") }

2010 Modularity Olympics

This is a contest, open to programming languages from all nations, to write modular and extensible code to solve the following problem: Implement a service that can run queries on a database.

The Challenge

Sounds simple right? Wrong! A programmer without control over the source-code of that service must be able to later add enhancements such as statistics collecting, timeouts, memoization, and so forth. There are a few more requirements:

  1. the “enhancements” must be specified in a configuration object which is consumed at run-time (e.g., it could be based on user-input).
  2. The enhancements are ordered (stats collecting wraps timeouts, not the other way around) but it must be possible to reverse the order of the enhancements at run-time.
  3. The enhancements must be “surgical” and not “global”. That is, it must be possible to simultaneously have two query services, one reversed and one not reversed, and even have a query service without any enhancements.
// Map/Reduce with Promises on Narwhal+Node
var SYSTEM = require("system");
var EL = require("event-loop");
var Q = require("narwhal/promise");
var UTIL = require("narwhal/util");
// to simulate a long latency, promise-returning API
var delay = function (timeout) {
var deferred = Q.Deferred();