Models | Examples |
---|---|
Display ads | Yahoo! |
Search ads |
/* use this function before inserting any array to mongo */ | |
array_walk_recursive($array,"typeCast"); | |
/* then do insert: $mongo->$db->$collection_name->insert($array); */ | |
/* careful with & sign before the $item, dont remove it, */ |
<?php | |
# Algorithm found here: http://www.hackerfactor.com/blog/index.php?/archives/432-Looks-Like-It.html | |
$filename = 'image.jpg'; | |
list($width, $height) = getimagesize($filename); | |
$img = imagecreatefromjpeg($filename); | |
$new_img = imagecreatetruecolor(8, 8); |
#!/bin/bash | |
git push $1 +HEAD:master | |
git fetch $1 | |
git push origin --tags |
<?php | |
// minimal routing | |
function web_app($routes, $req_verb, $req_path) { | |
$req_verb = strtoupper($req_verb); | |
$req_path = trim(parse_url($req_path, PHP_URL_PATH), '/'); | |
$found = false; | |
if (isset($routes[$req_verb])) { |
// via http://stackoverflow.com/questions/6677035/jquery-scroll-to-element | |
$('html,body').animate({ scrollTop: $('#target').offset().top }, 500) |
<?php | |
function it($m,$p){echo ($p?'✔︎':'✘')." It $m\n"; if(!$p){$GLOBALS['f']=1;}}function done(){if(@$GLOBALS['f'])die(1);} |
(A book that I might eventually write!)
Gary Bernhardt
I imagine each of these chapters being about 2,000 words, making the whole book about the size of a small novel. For comparison, articles in large papers like the New York Times average about 1,200 words. Each topic gets whatever level of detail I can fit into that space. For simple topics, that's a lot of space: I can probably walk through a very basic, but working, implementation of the IP protocol.
It's now here, in The Programmer's Compendium. The content is the same as before, but being part of the compendium means that it's actively maintained.
Disclaimer: This piece is written anonymously. The names of a few particular companies are mentioned, but as common examples only.
This is a short write-up on things that I wish I'd known and considered before joining a private company (aka startup, aka unicorn in some cases). I'm not trying to make the case that you should never join a private company, but the power imbalance between founder and employee is extreme, and that potential candidates would