Skip to content

Instantly share code, notes, and snippets.

View wjlroe's full-sized avatar
📷

William Roe wjlroe

📷
View GitHub Profile
@zed
zed / .gitignore
Created November 20, 2011 14:20
WebSocket Echo :python:twisted:txws:jquery:
/twistd.pid
/_trial_temp/
@panicsteve
panicsteve / gist:1641705
Created January 19, 2012 18:26
Form letter template for acquired startups
Dear soon-to-be-former user,
We've got some fantastic news! Well, it's great news for us anyway. You, on
the other hand, are fucked.
We've just been acquired by:
[ ] Facebook
[ ] Google
[ ] Twitter
require 'riak/cluster'
cluster = Riak::Cluster.new(:count => 4, :source => "/usr/local/Cellar/riak/1.0.3/libexec/bin", :root => "~/mycluster")
cluster.create
cluster.start
cluster.join
@mbbx6spp
mbbx6spp / README.md
Created February 7, 2012 17:58
Websockets with Netty (Scala translation) - WORK IN PROGRESS! Currently it expects an integer and will respond with its square. It isn't very interesting but it serves as a boilerplate/skeleton.

Experimentation with Netty and Scala's Types

Status

  • Only first pass complete: raw translation from Java example to Scala.
  • Second pass [incomplete]: abstracting to make server and client specific code composable.

TODO:

  • Create declarative and composable Pipeline definition
@bradwright
bradwright / darwin-keychain.el
Created February 12, 2012 11:39
How to get an OS X KeyChain entry in Emacs (useful for ERC etc.)
(defun chomp (str)
"Chomp leading and tailing whitespace from STR."
(while (string-match "\\`\n+\\|^\\s-+\\|\\s-+$\\|\n+\\'" str)
(setq str (replace-match "" t t str))) str)
(defun get-keychain-password (account-name)
"Gets `account` keychain password from OS X Keychain"
(chomp
(shell-command-to-string
(concatenate
@seancribbs
seancribbs / xmlsimple.erl
Created February 27, 2012 20:18
Module to simplify XML reading/manipulation stuffs in Erlang
%% @doc Uses SAX to convert an XML document into a simple nested-tuple
%% structure. Ignores namespaces.
-module(xmlsimple).
-export([file/1,
string/1,
emit/1,
emit_file/2]).
-include_lib("xmerl/include/xmerl.hrl").
@tlync
tlync / gist:1992497
Created March 7, 2012 10:54
Reload a web page on iPhone Simulator (elisp)
(defun web-reload-iphonesimulator ()
"Reload a page on iPhone Simulator. Run process associated to the *Messages* buffer"
(interactive)
(start-process-shell-command
"iphonesimulator-process"
"*Messages*"
"osascript -e 'tell application \"System Events\"' -e 'tell process \"iPhone Simulator\"' -e 'click button \"Reload\" of window 1' -e 'end tell' -e 'end tell'"))
@buritica
buritica / iosd
Created March 29, 2012 18:52
Enable Remote Inspector on Mobile Safari
#!/bin/bash
# Open iPhone Simulator on default location for XCode 4.3 if found
[[ -d /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone\ Simulator.app/ ]] &&
open /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone\ Simulator.app
# Open iPhone Simulator on default location for XCode 4.2 if found
[[ -d /Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone\ Simulator.app/ ]] &&
open /Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone\ Simulator.app
@maccman
maccman / juggernaut.rb
Created June 26, 2012 02:49
Sinatra Server Side Event streaming.
# Usage: redis-cli publish message hello
require 'sinatra'
require 'redis'
conns = []
get '/' do
erb :index
end
@toranb
toranb / filtersortpagemixin.js
Created September 24, 2012 02:37
filter/sort/pagination mixin for ember.js
var get = Ember.get;
/**
* @extends Ember.Mixin
*
* Implements common filter / sort / pagination behavior for array controllers
* */
Ember.FilterSortSliceMixin = Ember.Mixin.create({
filterBy: '',