Skip to content

Instantly share code, notes, and snippets.

View robinnorth's full-sized avatar
:octocat:

Robin North robinnorth

:octocat:
View GitHub Profile
@robinnorth
robinnorth / bash_cheat-sheet.sh
Created April 15, 2013 08:25
Bash: Cheat sheet
# chmod all files in directory, including .hidden files
chmod [MODE] .[a-zA-Z0-9_]*
# create gzipped tarball, preserving permissions
tar -c -p -v -z -f /home/example/www.example.com_site-2013-04-15.tar.gz -C /home/example/ .
# Recursively chmod only directories
find . -type d -exec chmod 755 {} \;
# Similarly, recursively set the execute bit on every directory
/* The Grid ---------------------- */
.lt-ie9 .row { width: 940px; max-width: 100%; min-width: 768px; margin: 0 auto; }
.lt-ie9 .row .row { width: auto; max-width: none; min-width: 0; margin: 0 -15px; }
.lt-ie9 .row.large-collapse .column,
.lt-ie9 .row.large-collapse .columns { padding: 0; }
.lt-ie9 .row .row { width: auto; max-width: none; min-width: 0; margin: 0 -15px; }
.lt-ie9 .row .row.large-collapse { margin: 0; }
.lt-ie9 .column, .lt-ie9 .columns { float: left; min-height: 1px; padding: 0 15px; position: relative; }
.lt-ie9 .column.large-centered, .columns.large-centered { float: none; margin: 0 auto; }
@corymartin
corymartin / flags.js
Created April 15, 2012 14:55
Flag Enumerations in JavaScript
// Flag Enumerations in JavaScript
// ===============================
// Flag enums
// ----------
// Values must increment by powers of 2
var SEASONS = {
Spring : 1,
Summer : 2,
@roboshoes
roboshoes / touchmouse.js
Created April 13, 2012 10:43
This snippet maps mouse events and touch events onto one single event. This makes it easier in the code since you have to listen to only one event regardles whether it's desktop or mobile.
(function() {
/* == GLOBAL DECLERATIONS == */
TouchMouseEvent = {
DOWN: "touchmousedown",
UP: "touchmouseup",
MOVE: "touchmousemove"
}
/* == EVENT LISTENERS == */
@gerad
gerad / console-stub.js
Created February 29, 2012 18:55
stub out the javascript console for IE
!function(w) {
debugger
if (!w.console) {
var c = w.console = {};
c.log = c.error = c.info = c.debug = c.warn = c.trace = c.dir = c.dirxml = c.group = c.groupEnd = c.time = c.timeEnd = c.assert = c.profile = c.profileEnd = function() {};
}
}(window);
@oodavid
oodavid / README.md
Last active April 6, 2024 18:45 — forked from aronwoost/README.md
Deploy your site with git

Deploy your site with git

This gist assumes:

  • you have a local git repo
  • with an online remote repository (github / bitbucket etc)
  • and a cloud server (Rackspace cloud / Amazon EC2 etc)
    • your (PHP) scripts are served from /var/www/html/
    • your webpages are executed by apache
  • apache's home directory is /var/www/
@maettig
maettig / LICENSE.txt
Created February 3, 2012 16:02 — forked from 140bytes/LICENSE.txt
isValidEan13 in 140byt.es
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2012 Thiemo Mättig <http://maettig.com>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@brianleroux
brianleroux / lawnchair-examples.js
Created January 27, 2011 06:32
examples for using lawnchair js
// create a new store
var store = new Lawnchair({adaptor:'dom', table:'people'});
// saving documents
store.save({name:'brian'});
// optionally pass a key
store.save({key:'config', settings:{color:'blue'}});
// updating a document in place is the same syntax