I took this from Brad Knutson's post. I'm putting it here so I never lose/forget about it. I'll be using it on my homepage at kent.doddsfamily.us
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Visual Customizations | |
function git_branch { | |
# Shows the current branch if in a git repository | |
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\ \(\1\)/'; | |
} | |
# Default Prompt | |
PS1="\w\$(git_branch): "; | |
# PATH ALTERATIONS |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
input::-webkit-outer-spin-button, | |
input::-webkit-inner-spin-button { | |
/* display: none; <- Crashes Chrome on hover */ | |
-webkit-appearance: none; | |
-moz-appearance: none; | |
margin: 0; /* <-- Apparently some margin are still there even though it's hidden */ | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Temp |
#Hello World Characters of Code Comparison
##JavaScript
Characters: 700
Lines of JavaScript: 13
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-(NSMutableArray *)sortCards:(NSMutableArray *)cards { | |
SEL selector = @selector(compareCard:); | |
NSArray *sortedArray = [cards sortedArrayUsingSelector:selector]; | |
return [sortedArray mutableCopy]; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function interval(func, wait, times) { | |
var interv = function(w, t) { | |
return function() { | |
if (typeof t === "undefined" || t-- > 0) { | |
setTimeout(interv, w); | |
try { | |
func.call(null); | |
} catch(e) { | |
t = 0; | |
throw e.toString(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function (root, factory) { | |
'use strict'; | |
if (typeof define === 'function' && define.amd) { | |
define(factory); | |
} else { | |
root.genie = factory(); | |
} | |
}(this, function() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe('docsSearchInput', function() { | |
var FORWARD_SLASH_KEYCODE = 191; | |
var inputElement, body; | |
beforeEach(function() { | |
body = angular.element(document.body); | |
body.empty(); | |
}); |