Skip to content

Instantly share code, notes, and snippets.

@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
@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 / 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!

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 / 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;
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 / .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
@io41
io41 / hack.sh
Created April 2, 2012 07:38 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2281433/hack.sh | sh
#
antimuon:~$ traceroute patents.com
traceroute: Warning: patents.com has multiple addresses; using 199.16.153.11
traceroute to patents.com (199.16.153.11), 64 hops max, 52 byte packets
1 10.0.1.1 (10.0.1.1) 8.736 ms 5.836 ms 4.002 ms
2 * * *
3 83-169-179-86-isp.superkabel.de (83.169.179.86) 41.602 ms 38.353 ms 39.961 ms
4 88-134-192-56-dynip.superkabel.de (88.134.192.56) 13.402 ms 9.123 ms 7.756 ms
5 88-134-204-150-dynip.superkabel.de (88.134.204.150) 11.027 ms 8.134 ms 13.547 ms
6 83-169-128-22.static.superkabel.de (83.169.128.22) 12.880 ms 23.179 ms 26.520 ms
7 88-134-201-117-dynip.superkabel.de (88.134.201.117) 9.068 ms 11.654 ms 10.706 ms

Create a public gist: