Skip to content

Instantly share code, notes, and snippets.

@Pradeek
Pradeek / localstorage-shim
Last active August 29, 2015 14:22
Local storage shim that works across old IEs and Safari's Private Browsing.
/***
* Local storage shim
* Taken from https://gist.github.com/remy/350433
* Local storage detection taken from https://gist.github.com/paulirish/5558557
* Modified to add {encode/decode}URIComponent to fix Safari's cookie semi-colon freak out.
***/
function doesLocalStorageEvenWork() {
try {
var str = "localStorage";
window.localStorage.setItem(str, str);
  • Dynamic Dispatch
  • Dynamic Method
  • Ghost Methods
  • Dynamic Proxies
  • Blank Slate
  • Kernel Method
  • Flattening the Scope (aka Nested Lexical Scopes)
  • Context Probe
  • Class Eval (not really a 'spell' more just a demonstration of its usage)
  • Class Macros
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active April 19, 2024 11:00
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active April 25, 2024 06:23
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@rmoriz
rmoriz / install-ruby-debug-ruby-1.9.3.sh
Created November 29, 2011 02:17 — forked from hoverlover/install-ruby-debug-ruby-1.9.3.sh
ruby-debug in ruby-1.9.3 and rbenv
#!/bin/bash
cd /tmp
wget http://rubyforge.org/frs/download.php/75414/linecache19-0.5.13.gem
wget http://rubyforge.org/frs/download.php/74596/ruby_core_source-0.1.5.gem
wget http://rubyforge.org/frs/download.php/75415/ruby-debug-base19-0.11.26.gem
wget http://rubyforge.org/frs/download.php/63094/ruby-debug19-0.11.6.gem
export RBENV_INCLUDE=$HOME/.rbenv/versions/1.9.3-p0/include/ruby-1.9.1/ruby-1.9.3-p0
gem install archive-tar-minitar
@remy
remy / gist:350433
Created March 31, 2010 14:58
Storage polyfill
if (typeof window.localStorage == 'undefined' || typeof window.sessionStorage == 'undefined') (function () {
var Storage = function (type) {
function createCookie(name, value, days) {
var date, expires;
if (days) {
date = new Date();
date.setTime(date.getTime()+(days*24*60*60*1000));
expires = "; expires="+date.toGMTString();