Skip to content

Instantly share code, notes, and snippets.

@peterwang
peterwang / helloword.lisp
Created May 30, 2010 04:56
Common Lisp Hello World
(format t "Hello World!")
<?php
// cascading configurations via
// merging with defaults options
$defaults = array(
'foo' => 'bar',
'baz' => 'qux',
'quux' => 'fred',
);
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
Prelude Data.Char> mapM_ (putChar . chr) [0..127]
<?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);
* install git-annex on mac os x 10.8.4
# cabal -v install --ghc-options=-L/usr/lib git-annex
Description:
php5-fpm process coredump-ed when apcu_clear_cache() and opcache_reset() was called
OS:
Linux www 3.2.0-54-virtual #82-Ubuntu SMP Tue Sep 10 20:31:18 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
Packages:
ii php-apc 4.0.2-2+debphp.org~precise+1 APC User Cache for PHP 5 (transitional package)
ii php-pear 5.5.8+dfsg-3+sury.org~precise+2 PEAR - PHP Extension and Application Repository
ii php5 5.5.8+dfsg-3+sury.org~precise+2 server-side, HTML-embedded scripting language (metapackage)
cd com.supercell.hayday_1.23.250/assets/data;
for f in *.csv ; do (dd if=$f bs=1 count=9 2>/dev/null; echo -ne "\x00\x00\x00\x00"; dd if=$f skip=9 bs=1 2>/dev/null;) | lzcat > $f.new.csv; done

Keybase proof

I hereby claim:

  • I am peterwang on github.
  • I am peterwang (https://keybase.io/peterwang) on keybase.
  • I have a public key whose fingerprint is CF77 DB56 4076 B137 2037 3B76 8A85 A07F 0781 46AF

To claim this, I am signing this object:

;;; print all threads
(->> (Thread/getAllStackTraces)
keys
(map (juxt (memfn getId)
(memfn getName)))
(sort-by first)
pprint)