Skip to content

Instantly share code, notes, and snippets.

View williamdodson's full-sized avatar
🏠
Working from home

William Dodson williamdodson

🏠
Working from home
View GitHub Profile
/*
Inline-block for IE6, Firefox 2, and up
via http://blog.mozilla.com/webdev/2009/02/20/cross-browser-inline-block
*/
@module inline-block {
display: -moz-inline-stack;
display: inline-block;
zoom: 1;
*display: inline;
@williamdodson
williamdodson / obxdesignworks
Created March 23, 2011 18:04
Track PDF files in Google Analytics with jQuery
/**
* Place this code after your Google Analytics scripts
*/
$(function() {
/* any links to PDFs are tracked with GA */
$('a[href$="pdf"]').click(function(e){
/* grab only the file name without the extension */
var fullpath = $(this).attr('href');
var filename = fullpath.substr(fullpath.lastIndexOf("/")+1, fullpath.length);
_gaq.push(['_trackPageview', '/'+filename]);
@williamdodson
williamdodson / reset.css
Created May 6, 2011 22:30
Reset CSS (Eric Meyer's v2 Reset with HTML5 declarations)
/**
* Eric Meyer's v2 Reset with HTML5 declarations
* http://meyerweb.com/eric/tools/css/reset/
*/
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
@williamdodson
williamdodson / dock-spacers
Created July 15, 2011 17:13
Create Spacers in the OS X Dock
/**
* Run the following in a Terminal window to add invisible spacers to the Dock (great for grouping apps).
* Once ran, simply look for the empty space at the right-hand end of the dock, next to the
* static dotted spacer and drag into place. Repeat as needed for as many spacers as you like
*/
defaults write com.apple.dock persistent-apps -array-add '{"tile-type"="spacer-tile";}'; killall Dock
@williamdodson
williamdodson / remove.svn
Created July 15, 2011 21:30
Recursively Remove Subversion .svn Folders
rm -rf `find . -type d -name .svn`
@williamdodson
williamdodson / README.markdown
Created August 13, 2011 13:11 — forked from ariera/README.markdown
Nestable, sortable and dragable categories

Nestable, sortable and dragable categories:

In the project I'm working on we wanted to have a Category model which we wanted to be nestable. But we also liked the user to have a draggable interface to manage and rearrange the order of his categories. So we chose awesome_nested_set for the model and jQuery.nestedSortable for the UI.

It took me some time to arrange things to work properly so I wanted to share my work in case it helps anybody.

Before beginning

you might want to take a look at a demo app

  1. go to: http://awesomenestedsortable.heroku.com/groups/
  2. click in show of any group
@williamdodson
williamdodson / gist:1163648
Created August 22, 2011 21:28 — forked from voodootikigod/gist:1155790
PyCodeConf Ticket Give-away
Day job: Owner, Outer Banks Design Works
Favorite Python project: Django
Favorite Conference: SXSW
Python Experience Level: Intermediate (enough to be dangerous)
@williamdodson
williamdodson / 320up.less
Created December 7, 2011 17:09 — forked from peterwilsoncc/320up.less
“Mobile first” CSS and getting LESS to help with legacy IE
.320up(){
.three20 {
color: #fff;
}
} /* end 320up mixin */
@williamdodson
williamdodson / install-rvm.sh
Created December 20, 2011 15:22 — forked from alanstevens/install-rvm.sh
Shell script to install rvm and rails
#!/bin/bash
bash < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)
echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function' >> ~/.bash_profile
source ~/.bash_profile
rvm install 1.9.2
rvm use 1.9.2 --default
rvm use 1.9.2@global
gem install rails --no-rdoc --no-ri
gem install bundler --no-rdoc --no-ri
@williamdodson
williamdodson / product_generator.rb
Created December 21, 2011 21:28 — forked from jpravetz/product_generator.rb
Jekyll generator to read json data file and generate product and ingredient pages
#------------------------------------------------------------------------
# encoding: utf-8
# @(#)product_generator.rb 1.00 29-Nov-2011 16:38
#
# Copyright (c) 2011 Jim Pravetz. All Rights Reserved.
# Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
#
# Description: A generator that creates product, products and
# ingredients pages for jekyll sites. Uses a JSON data
# file as the database file from which to read and