Skip to content

Instantly share code, notes, and snippets.

@azappella
azappella / get-cookie.js
Created October 3, 2014 11:34
Get Cookie
<!doctype html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>Raycaster Demo - PlayfulJS</title>
</head>
<body style='background: #000; margin: 0; padding: 0'>
<canvas id='display' width='1' height='1' style='width: 100%; height: 100%;' />
<script>
{
"directory": "components"
}

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
@azappella
azappella / hamburger-icon.css
Last active August 29, 2015 13:57
Mobile Menu Icon
.icon_hamburger {
width: 1.625em;
height: .313em;
background: black;
}
.icon_hamburger:before,
.icon_hamburger:after {
width: 1.625em;
height: .313em;
@azappella
azappella / localStoragePolyfill.js
Last active December 31, 2015 15:29
This algorithm is an exact imitation of the localStorage object, but makes use of cookies.
// Source: https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Storage
// Here is another, less exact, imitation of the localStorage object. It is
// simpler than the previous one, but it is compatible with old browsers,
// like Internet Explorer < 8 (tested and working even in Internet Explorer 6).
// It also makes use of cookies.
// Note: The maximum size of data that can be saved is severely restricted
// by the use of cookies. With this algorithm, use the functions localStorage.setItem()
// and localStorage.removeItem() to add, change, or remove a key. The use of methods
@azappella
azappella / rAF-old.js
Last active December 19, 2015 13:29 — forked from paulirish/rAF.js
// shim layer with setTimeout fallback
window.requestAnimFrame = (function(){
return window.requestAnimationFrame ||
window.webkitRequestAnimationFrame ||
window.mozRequestAnimationFrame ||
function( callback ){
window.setTimeout(callback, 1000 / 60);
};
})();

Sublime Text 2 – Useful Shortcuts (PC)

Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.

Editing

Ctrl+C copy current line (if no selection)
Ctrl+X cut current line (if no selection)
Ctrl+⇧+K delete line
Ctrl+↩ insert line after
// Ported from Stefan Gustavson's java implementation
// http://staffwww.itn.liu.se/~stegu/simplexnoise/simplexnoise.pdf
// Read Stefan's excellent paper for details on how this code works.
//
// Sean McCullough banksean@gmail.com
/**
* You can pass in a random number generator object if you like.
* It is assumed to have a random() method.
*/
@azappella
azappella / .gitaliases
Created April 9, 2013 11:33
.bashrc (git aliases)
# http://www.catonmat.net/blog/git-aliases/
alias ga='git add'
alias gp='git push'
alias gl='git log'
alias gs='git status'
alias gd='git diff'
alias gdc='git diff --cached'
alias gm='git commit -m'
alias gma='git commit -am'
alias gb='git branch'