Skip to content

Instantly share code, notes, and snippets.

@RoboTeddy
RoboTeddy / keyboard.coffee
Last active August 29, 2015 14:03
Bacon.js keyboard
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.
@staltz
staltz / introrx.md
Last active July 15, 2024 15:43
The introduction to Reactive Programming you've been missing
@wilmoore
wilmoore / readme.md
Last active December 28, 2021 20:06
Git :: Personal Git Configuration
@femto113
femto113 / transpose.js
Last active September 6, 2023 00:28
one line transpose for 2-dimensional Javascript arrays
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]));
}
@shameerc
shameerc / mysql_prepared_functions.php
Created January 1, 2011 05:41
This is a part of mysqli class for prepared statements
<?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
*
*/