Skip to content

Instantly share code, notes, and snippets.

@pib
pib / harassATXHS.sh
Created October 25, 2011 19:34
Sending a single message to a specific IRC channel
#!/bin/bash
nc -i 10 irc.freenode.net 6667 <<EOF
USER pib_netcat foo bar :Baz Bon
: NICK pib_netcat
: JOIN #austinhackerspace
: PRIVMSG #austinhackerspace :What up, bitnotches?
: PART #austinhackerspace
EOF
@pib
pib / hexdump.hs
Created October 16, 2010 01:01
hexdump in Haskell
import Data.Char
import System.IO
import Text.Printf
main = do
hSetBinaryMode stdin True
contents <- getContents
putStr (hexdump contents)
hexdump :: String -> String
@pib
pib / sexp.py
Created November 23, 2009 07:57
A simple Python s-expression parser.
from string import whitespace
atom_end = set('()"\'') | set(whitespace)
def parse(sexp):
stack, i, length = [[]], 0, len(sexp)
while i < length:
c = sexp[i]
print c, stack