View git-tidy-alias
[alias] | |
tidy = !git branch --merged master | grep -v 'master$' | xargs git branch -d && git remote | xargs -n 1 git remote prune |
View 1password
# Serve 1Password anywhere from the Dropbox folder | |
server { | |
listen 80; | |
server_name 1password; | |
root /home/kflorence/Dropbox/1Password.agilekeychain; | |
location / { | |
index 1Password.html; | |
} | |
} |
View .bash_profile
function parse_git_branch { | |
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' | |
} | |
# Nicer looking prompt with git branch in it | |
# https://github.com/mbadolato/iTerm2-Color-Schemes | |
export PS1="\[\033[36m\]\u\[\033[m\]:\[\033[33;1m\]\w\[\033[m\]\[\033[35;1m\]\$(parse_git_branch)\[\033[m\]\$ " | |
# ls colors | |
export CLICOLOR=1 |
View jquery.plugin.js
(function($) { | |
// $.widget-lite | |
$.plugin = function(name, base, prototype) { | |
if (!prototype) { | |
prototype = base; | |
base = function(options, element) { | |
if (arguments.length) { | |
$.data(element, name, this); | |
this.element = $(element); | |
this._init(options); |
View ieChangeFix.js
/** | |
* Fixes binding the "change" event to checkboxes and select[type=multiple] | |
* for Internet Explorer. | |
* | |
* @param {jQuery|Element|Element[]} elements | |
* The DOM Element we wish to bind the event to. | |
* | |
* @param {String} eventType | |
* The name of the event we want to bind to. | |
* |
View IE_Version_Testing.js
// ---------------------------------------------------------- | |
// A short snippet for detecting versions of IE in JavaScript | |
// without resorting to user-agent sniffing | |
// ---------------------------------------------------------- | |
// If you're not in IE (or IE version is less than 5) then: | |
// ie === undefined | |
// If you're in IE (>=5) then you can determine which version: | |
// ie === 7; // IE7 | |
// Thus, to detect IE: | |
// if (ie) {} |
View jquery-attached-detatched.js
(function( jQuery ) { | |
jQuery.extend({ | |
attached: function( elem ) { | |
if ( elem instanceof jQuery ) { | |
elem = elem[ 0 ]; | |
} | |
return jQuery.contains( elem.ownerDocument.documentElement, elem ); | |
}, | |
detached: function( elem ) { |
View isArrayLike.js
(function( jQuery ) { | |
// Determines if we can treat an object like an array. | |
var isArrayLike = function( obj ) { | |
var length; | |
// Supports arrays, jQuery objects, nodeLists and HTMLCollections | |
// Should also support function arguments, but there is no cross-browser way... | |
return obj && ( obj instanceof jQuery || ( typeof obj === "object" && | |
!jQuery.isWindow( obj ) && ( typeof ( length = obj.length ) === "number" && | |
( obj.item && ( obj.namedItem || jQuery.isFunction( obj.item ) ) ) ) || jQuery.isArray( obj ) ) ); |
OlderNewer