NOW MAINTAINED IN MY DOTFILES GITHUB REPO: http://git.io/zuH1MQ
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @param mixed $query Query to be prepared for executing | |
* multiple times | |
* Usage "SELECT * FROM table_name WHERE column = ? " | |
* "INSERT INTO table_name(field1,field2) VALUES(?,?) "; | |
* returns true if the query is a valid mysql statement else throws an | |
* exception | |
* | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function transpose(a) | |
{ | |
return a[0].map(function (_, c) { return a.map(function (r) { return r[c]; }); }); | |
// or in more modern dialect | |
// return a[0].map((_, c) => a.map(r => r[c])); | |
} |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Bacon = require 'Bacon' | |
_ = require 'underscore' | |
$ = require 'jquery' | |
# Reference: http://unixpapa.com/js/key.html | |
# IE = IE keycodes (webkit, IE) | |
# MZ = Mozilla keycodes (gecko) | |
# Opera = Opera keycodes (opera) | |
# US locale specific. About as well as can be done without browser detection. |