Skip to content

Instantly share code, notes, and snippets.

* install git-annex on mac os x 10.8.4
# cabal -v install --ghc-options=-L/usr/lib git-annex
<?php
$input = isset($argv[1]) ? $argv[1] : 'fb.com/username';
$pattern = '#(?:https?\://)?(?:www\.)?(?:facebook|fb)\.com/(\d+|[A-Za-z0-9\.]+)/?#';
var_dump(preg_match($pattern, $input, $matches));
var_dump($matches);
Prelude Data.Char> mapM_ (putChar . chr) [0..127]
import System.Directory
import System.IO
testFileSize :: String -> Int -> IO ()
testFileSize filepath size = do
writeFile filepath $ replicate size '\0'
openFile filepath ReadMode >>= hFileSize >>= putStrLn.show
<?php
// cascading configurations via
// merging with defaults options
$defaults = array(
'foo' => 'bar',
'baz' => 'qux',
'quux' => 'fred',
);
@peterwang
peterwang / helloword.lisp
Created May 30, 2010 04:56
Common Lisp Hello World
(format t "Hello World!")