Skip to content

Instantly share code, notes, and snippets.

Sending: ["multiply",4,7,{"__type":"callback","id":"dHx9"}]
Recieved: ["callback","dHx9",[28]]
g++ `pkg-config --cflags --libs gtkmm-3.0` -o ./thing ./thing.cpp
&b\t \x1b[1m
&/b\t \x1b[22m
&i\t \x1b[3m
&/i\t \x1b[23m
&u\t \x1b[4m
&/u\t \x1b[24m
&s\t \x1b[9m
&/s\t \x1b[29m
@summer4096
summer4096 / parser.js
Created July 8, 2012 23:19
dAmn packet parser
function(rpkt, depth){
try {
rpkt = rpkt.toString();
depth = depth || 0;
var i;
var ppkt = {
cmd: null,
param: null,
args: {},
body: null,
@summer4096
summer4096 / wikipedia.sh
Created June 6, 2012 21:21
This snippet will download the May 2012 wikipedia dump, extract it, convert it to sql, and feed it to mysql, all at the same time.
curl http://dumps.wikimedia.org/enwiki/20120502/enwiki-20120502-pages-articles-multistream.xml.bz2 | bzcat | ./import.pl | mysql -f -uuser -ppass --default-character-set=utf8 wikipedia
$upload = $this->input->files->avatar;
if ($upload && $upload->ext == 'png' && $upload->width <= 100 && $upload->height <= 100) {
$upload->move(DIR_PUBLIC.'avatars/');
}
$this->colorcache = new cache('favoritecolors', 'memcached', 'file');
if ( !isset($this->colorcache->tristan) ) {
$this->colorcache->tristan = 'blue';
}
echo $this->colorcache->tristan;