Skip to content

Instantly share code, notes, and snippets.

View jperras's full-sized avatar
💨
what what is this where am I

Joël Perras jperras

💨
what what is this where am I
View GitHub Profile
@jperras
jperras / httpdump
Created April 19, 2009 23:10 — forked from peterc/httpdump
# Monitor HTTP requests being made from your machine with a one-liner..
# Replace "en1" below with your network interface's name (usually en0 or en1)
sudo tcpdump -i en1 -n -s 0 -w - | grep -a -o -E "Host\: .*|GET \/.*"
# OR.. to be able to use as "httpdump" from anywhere, drop this into ~/.bash_profile:
# (again replace "en1" with correct network interface name)
alias httpdump="sudo tcpdump -i en1 -n -s 0 -w - | grep -a -o -E "Host\: .*|GET \/.*""
# All the above tested only on OS X.
<?php
function Y($F) {
return current(array(function($f) {
return $f($f);
}))->__invoke(function($f) use ($F) {
return $F(function($x) use ($f) {
return $f($f)->__invoke($x);
});
});
}
<?php
function ordinal($number) {
$default = 'th';
$suffixes = array('th', 'st', 'nd', 'rd');
if ( ($number % 100 > 10 && $number % 100 < 14) || ($number % 10 > 3 ) ) {
$result = sprintf('%d%s', $number, $default);
}
else {
$index = $number % 10;
USE: io
IN: hello-world
: hello ( -- ) "Hello world" print ;
MAIN: hello
main = putStrLn "Hello World"
HAI
VISIBLE "HAI WORLD!"
KTHXBYE
print *,"Hello World!"
#!/usr/bin/env python
import redis
from optparse import OptionParser
from time import sleep
def options():
parser = OptionParser()
parser.add_option("--host", default="localhost")
parser.add_option("--port", type="int", default=6379)
import redis
def encode(word):
return word.encode('rot13')
def cleanup():
db.delete('eng')
db.delete('eng-rot13')
if __name__ == "__main__":
.mouse{
position: absolute;
background-image: url('../images/cursor.png');
width: 15px;
height: 22px;
z-index: 100;
}