Skip to content

Instantly share code, notes, and snippets.

@luflow
luflow / best-localStorage-polyfill-evar.js
Last active April 12, 2017 08:13 — forked from juliocesar/best-localStorage-polyfill-evar.js
This is the best localStorage polyfill in the world
// I mean, seriously, localStorage is supported even by your mum. How about instead of
// casing the feature out, you give users in-memory (stale) storage instead?
// If they close your application, they deserve to lose data anyway.
if (!('localStorage' in window)) {
window.localStorage = {
_data : {},
setItem : function(id, val) { return this._data[id] = String(val); },
getItem : function(id) { return this._data.hasOwnProperty(id) ? this._data[id] : null; },
removeItem : function(id) { return delete this._data[id]; },
@luflow
luflow / gist:bf4fd36946f069ee22cf
Last active October 5, 2015 16:54 — forked from zeuxisoo/MAMP with Python-MySQLdb.txt
Mac OS X 10.10 Yosemity MAMP installation of MySQL-python
Last tested Oct 2015
OS X 10.10.5
MAMP 3.4
0. Get your MySQL Version: /Applications/MAMP/Library/bin/mysql --version
1. Goto http://downloads.mysql.com/archives/community/
2. Select Platform: "Mac OS X"
3. Download correct version with latests OS version (see step 0 - in my case 5.5.42)
Mac OS X 10.9 (x86, 64-bit), Compressed TAR Archive mysql-5.5.42-osx10.9-x86_64.tar.gz
The version for Mac OS X 10.9 also worked on my OS X 10.10