Skip to content

Instantly share code, notes, and snippets.

@lotsofcode
lotsofcode / Custom.css
Created May 25, 2012 10:00 — forked from bentruyman/Custom.css
IR_Black Theme for Chrome Developer Tools
/**********************************************/
/*
/* IR_Black Skin by Ben Truyman - 2011
/*
/* Based on Todd Werth's IR_Black:
/* http://blog.toddwerth.com/entries/2
/*
/* Inspired by Darcy Clarke's blog post:
/* http://darcyclarke.me/design/skin-your-chrome-inspector/
/*
@lotsofcode
lotsofcode / gist:2556913
Created April 30, 2012 09:46
iterate through templates and create sub-templates
TEMPLATES=$(cat templates.txt);
SUB_TEMPLATES=$(cat sub-templates.txt);
for SUB_TEMPLATE in $SUB_TEMPLATES; do
for TEMPLATE in $TEMPLATES; do
touch templates/$TEMPLATE.$SUB_TEMPLATES.txt
done
done
@lotsofcode
lotsofcode / gist:2503723
Created April 26, 2012 22:27
jQuery Boilerplate
;(function($, undefined) {
$.REPLACE_PLUGIN_NAME = function(element, options) {
var defaults = {}
var plugin = this;
plugin.settings = {}
var $element = $(element), element = element;
plugin.init = function() {
plugin.settings = $.extend({}, defaults, options);
private_method()
plugin.public_method()
@lotsofcode
lotsofcode / gist:2375846
Created April 13, 2012 10:56
Useful git commands

Show commits different between (could be useful or generating a changelog)

git log origin/master..master --format="%h %s [%an]"

Essentially, this is a git log ..

Pretty log format

git log --pretty=format:"%h %ad | %s%d [%an]" --graph --date=short

@lotsofcode
lotsofcode / gist:2344460
Created April 9, 2012 16:06
Simple copying and replacing and outputting to a new file
sed 's/STRING_1/STRING_2/' input.file >> output.file
@lotsofcode
lotsofcode / .gitconfig
Created April 5, 2012 12:19
Git config file
# @use --global flag to assign to home ~/.gitconfig instead of local ~/.git/config file
# For example
# Disable filemode changes.
# $ git config core.filemode false
# Disable filemode changes globally.
# $ git config --global core.filemode false
@lotsofcode
lotsofcode / concat.sql
Created April 3, 2012 20:26
mysql commands
SELECT CONCAT('Mr. ', forename, ' ', surname, ' - ', jobTitle) FROM table;
@lotsofcode
lotsofcode / gist:2293887
Created April 3, 2012 17:26
Find unique commits by author
git log --pretty=format:'%s' --author=Luke | grep -v "Merge branch" | sort -u
@lotsofcode
lotsofcode / hack.sh
Created March 31, 2012 11:28 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@lotsofcode
lotsofcode / .git_ps1
Created February 14, 2012 17:51
Git ps1
#!/bin/bash
#
# DESCRIPTION:
#
# Set the bash prompt according to:
# * the branch/status of the current git repository
# * the branch of the current subversion repository
# * the return value of the previous command
#
# USAGE: