Skip to content

Instantly share code, notes, and snippets.

@sich
sich / 0_reuse_code.js
Created September 29, 2016 11:03
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@sich
sich / gist:9178007
Last active August 29, 2015 13:56
Perfectly balanced tree
function tree(&$tree, $num_nodes)
{
if($num_nodes == 0)
return null;
$left = (int)($num_nodes / 2);
$right = $num_nodes - $left -1;
$tree[]['value'] = (int)(mt_rand( 1, 50) / $num_nodes+1);
$last = count($tree)-1;
@sich
sich / modems.conf
Created January 26, 2013 20:53
Kannel modems conf for Alcatel X200L
group = modems
id = generic
name = "Generic Modem"
speed = 9600
init-string = "AT+CNMI=1,2,2,2,1"