Skip to content

Instantly share code, notes, and snippets.

@io41
io41 / .inputrc
Created April 2, 2012 07:59 — forked from gregorynicholas/.inputrc
OSX .inputrc to make terminal way better. and by better i mean i'm naked
"\e[1~": beginning-of-line
"\e[4~": end-of-line
“\e[5~”: history-search-backward
“\e[6~”: history-search-forward
"\e[3~": delete-char
"\e[2~": quoted-insert
"\e[5C": forward-word
"\e[5D": backward-word
"\e\e[C": forward-word
"\e\e[D": backward-word
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by GnuTLS configure 2.12.18, which was
generated by GNU Autoconf 2.68. Invocation command line was
$ ./configure --disable-debug --disable-dependency-tracking --disable-guile --disable-static --prefix=/usr/local/Cellar/gnutls/2.12.18 --with-libgcrypt --without-p11-kit
## --------- ##
## Platform. ##
@io41
io41 / gist:2842791
Created May 31, 2012 11:31
poker planning cards
<html>
<head>
<style type="text/css">
.card {
height: 2in;
width: 2in;
border: 0.1in solid black;
border-radius: 0.25in;
display: inline-block;
margin: 1px 1px 0 0;
From home:
Transactions: 1730 hits
Availability: 100.00 %
Elapsed time: 94.71 secs
Data transferred: 0.24 MB
Response time: 0.31 secs
Transaction rate: 18.27 trans/sec
Throughput: 0.00 MB/sec
Concurrency: 5.65
@io41
io41 / tree.md
Created January 3, 2013 11:22 — forked from hrldcpr/tree.md

One-line Tree in Python

Using Python's built-in defaultdict we can easily define a tree data structure:

def tree(): return defaultdict(tree)

That's it!

@io41
io41 / gist:6592046
Created September 17, 2013 09:23
Track dom element clicks. Tested on chrome.
var getPath = function(el) {
var path = elName = "";
var siblings, siblingId;
while(el && elName != "body") {
elName = el.nodeName.toLowerCase();
siblings = (el.parentNode)?el.parentNode.childNodes:[];
siblingId = 0;
for (var i = 0; i < siblings.length; i++) {
@io41
io41 / tts.fish
Created September 19, 2013 15:25 — forked from anonymous/tts.fish
function tts
set q $argv;
mplayer "http://translate.google.com/translate_tts?ie=UTF-8&q=$q&tl=en&textlen="(math (echo "$q" | wc -m) - 1)"idx=0&total=1&prev=input";
end
history={'data': [
{
'o': 0, /* offset */
'h': 1, /* horizontal slide index */
'v': 0, /* vertical slide index */
},
{
'o': 120,
'h': 2,
'v': 0,
/**
* computes the what elements were added to, and removed from, s1
* to obtain s2, where s1 and s2 are assumed to be unordered Array
* possibly with duplicates
* uDiff([1,3], [2,3]) --> {added: [2], removed: [1]}
* uDiff([1,2,3], [2,3,1]) --> {added: [], removed: []}
* uDiff([1,2,1], [1,2,2]) --> {added: [2], removed: [1]}
* @param s1 Array
* @param s2 Array
@io41
io41 / Makefile
Last active August 29, 2015 14:22 — forked from kwlzn/Makefile
PYTHON := python2.6
BUILD_DIR := buildtmp
AURORA_CLUSTER := test
AURORA_ROLE := $(shell whoami)
UWSGI_VER = 2.0.4
UWSGI_DIR = uwsgi-$(UWSGI_VER)
UWSGI_FILE = $(UWSGI_DIR).tar.gz
UWSGI_URL = http://projects.unbit.it/downloads/$(UWSGI_FILE)