Skip to content

Instantly share code, notes, and snippets.

View lukemartin's full-sized avatar
🐱
hello

Luke Martin lukemartin

🐱
hello
View GitHub Profile
@lukemartin
lukemartin / gist:1071283
Created July 8, 2011 06:59
JavaScript: Generic.js
// Global UI object
var UI = UI || {};
// Generic methods
UI.Generic = (function ($) {
var my = {};
// init methods
my.init = function () {
@lukemartin
lukemartin / gist:1071281
Created July 8, 2011 06:59
JavaScript: Loose augmentation pattern
// Global UI object
var UI = UI || {};
UI.Generic = (function($) {
var my = {};
// Public
my.foo = "Something";
my.bar = function() {
return "Something else";
@lukemartin
lukemartin / gist:1071273
Created July 8, 2011 06:52
JavaScript: Method comments
/**
* Description of the method
* @param {Object} param1 description of object
* @param {String} param2 description of string
* @param {Int} param3 description of integer
*/
var something = function(param1, param2, param3) {
return;
};
@lukemartin
lukemartin / gist:1071270
Created July 8, 2011 06:49
JavaScript: jQuery plugin template
(function ($) {
$.fn.droppie = function (options) {
// override options
var opts = $.extend({}, $.fn.plugin.defaults, options);
return this.each(function() {
$.fn.plugin.something();
});
};
@lukemartin
lukemartin / gist:1070357
Created July 7, 2011 19:40
Git: cheat sheet
# Remove deleted files from repo
$ git add -u
# Delete untracked files from local disk
$ git clean -f
# Amend previous commit (only unpushed commits)
$ git commit --amend