Skip to content

Instantly share code, notes, and snippets.

View jackfranklin's full-sized avatar

Jack Franklin jackfranklin

View GitHub Profile
jQuery.fn.jQuote = function(options) {
var defaults = {
quoteClass : '.quote',
blockQuoteClass: 'jquote-block'
};
var settings = $.extend({}, defaults, options);
return this.each(function() { });
};
@jackfranklin
jackfranklin / gist:1347654
Created November 8, 2011 12:40
New Computer Set up Notes
BEFORE:
Full back-up to Time Machine
Make sure Dropbox is fully synced
Run FolderWatch to move User drive to Media HD
Try & back-up ext monitor colour profile (can you?)
AFTER:
Restart laptop & hold down Command-R to enter Lion recovery.
Format SSD
@jackfranklin
jackfranklin / gist:1354957
Created November 10, 2011 14:27
Lisp flatten a list
;Flattens a list, e.g., ((a b) ((c)) d) -> (a b c d)
(defun flatten (li)
(cond ((null li) nil)
((atom li) `(,li) ) ;;THIS CONFUSES ME :(
(t (mapcan #'flatten li))))
(print (flatten `(a (a b) (a b (a c)))))
@jackfranklin
jackfranklin / triangle.java
Created December 1, 2011 21:17
Java Help for Josh
public class Triangle
{
private float x;
private float y;
private float z;
private float perimeter;
private float s;
private float area;
public Triangle(float a, float b, float c)
{
@jackfranklin
jackfranklin / gist:1837026
Created February 15, 2012 16:21
Install Node, NPM and CS on Ubuntu
sudo apt-get install nodejs npm
npm install coffee-script -g
@jackfranklin
jackfranklin / gist:1845635
Created February 16, 2012 15:31
HTML Limerick cos I'm cool
var limerick = (function() {
return "The code I write is quick
It's really really slick
I jumped into Vim
Implemented a HTML 5 shim
And now I don't look quite so thick"
})();
if(options.slide == 'up') { $(this).slideUp(time, options.callback);} // slide Up
else if(options.slide == 'down') { $(this).slideDown(time, options.callback);} // slide down
else if(options.slide == 'toggle') {$(this).slideToggle(time, options.callback);} // slide toggle
$(this)["slide" + options.slide.charAt(0).toUpperCase() + options.slide.slice(1)](time, options.callback);
@jackfranklin
jackfranklin / pubsub.md
Created April 12, 2012 10:15 — forked from addyosmani/pubsub.md
Four ways to do Pub/Sub with jQuery 1.7 and jQuery UI (in the future)

#Four Ways To Do Pub/Sub With jQuery 1.7 and jQuery UI (in the future)

Between jQuery 1.7 and some of work going into future versions of jQuery UI, there are a ton of hot new ways for you to get your publish/subscribe on. Here are just four of them, three of which are new.

(PS: If you're unfamiliar with pub/sub, read the guide to it that Julian Aubourg and I wrote here http://msdn.microsoft.com/en-us/scriptjunkie/hh201955.aspx)

##Option 1: Using jQuery 1.7's $.Callbacks() feature:

$.Callbacks are a multi-purpose callbacks list object which can be used as a base layer to build new functionality including simple publish/subscribe systems. We haven't yet released the API documentation for this feature just yet, but for more information on it (including lots of examples), see my post on $.Callbacks() here:

@jackfranklin
jackfranklin / gist:2895255
Created June 8, 2012 12:01
Remove Specific Folders or Files from Sublime Text 2 Projects
{
"folders":
[
{
"path": "/Users/JackFranklin/Dropbox/Sites/clients/karyx/twf",
"file_exclude_patterns": ["*.scssc"]
}
]
}
@jackfranklin
jackfranklin / gist:2920481
Created June 12, 2012 22:20
Deploying with Capistrano
set :application, "tas"
set :repository, "" #your Github repo
set :scm, :git
# Or: `accurev`, `bzr`, `cvs`, `darcs`, `git`, `mercurial`, `perforce`, `subversion` or `none`
set :deploy_to, "/home/jackfranklin/webapps/rails"
role :web, "web306.webfaction.com" # Your HTTP server, Apache/etc
role :app, "web306.webfaction.com" # This may be the same as your `Web` server
role :db, "web306.webfaction.com", :primary => true # This is where Rails migrations will run