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
[alias] | |
tidy = !git branch --merged master | grep -v 'master$' | xargs git branch -d && git remote | xargs -n 1 git remote prune |
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
/*! | |
* jQuery Floating Scrollbar - v0.5 - 09/05/2013 | |
* http://benalman.com/ | |
* | |
* Copyright (c) 2011 "Cowboy" Ben Alman | |
* Dual licensed under the MIT and GPL licenses. | |
* http://benalman.com/about/license/ | |
*/ | |
(function($, window){ |
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
Show hidden characters
{ | |
// Wikia .jshintrc | |
// Enforcing | |
"bitwise": true, | |
"camelcase": true, | |
"curly": true, | |
"eqeqeq": true, | |
"immed": true, | |
"latedef": true, |
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 unit( scope ) { | |
return parseInt( window.getComputedStyle( scope || document.body ).fontSize, 10 ); | |
} | |
function pxToEm( px, scope ) { | |
return ( parseInt( px, 10 ) / unit( scope ) ).toFixed( 8 ) + 'em'; | |
} | |
function emToPx( em, scope ) { | |
return Math.round( parseFloat( em ) * unit( scope ) ) + 'px'; |
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
[alias] | |
br = branch | |
ci = commit | |
cl = clone | |
co = checkout | |
cp = cherry-pick | |
df = diff | |
lg = log --pretty=format:\"%h %ad | %s%d [%an]\" --graph --date=short | |
mg = merge --no-ff | |
pl = pull --rebase |
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
# Put this in ~/.bash_profile on your devbox | |
# Run it like: $ update-config | |
function update-config { | |
echo "Updating config..." | |
cd /usr/wikia/docroot | |
git pull --rebase | |
mkdir -p wiki.factory | |
ln -sf /usr/wikia/source/wiki/extensions/wikia/Development/Configs_DevBox/LocalSettings.php wiki.factory/LocalSettings.php | |
perl /usr/wikia/docroot/clinks.pl --source=/usr/wikia/source/wiki --docroot=/usr/wikia/docroot/wiki.factory |
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
// join( { one: "one", two: "two" } ); | |
// => "one,two" | |
function join( obj, separator ) { | |
var k, | |
items = []; | |
if ( typeof obj.join === "function" ) { | |
items = obj; | |
} else { |
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
// namespacer( "kf", [ "one", "two" ] ); | |
// => { one: "one.kf", two: "two.kf" } | |
function namespacer( namespace, items, separator, before ) { | |
var i, item, | |
l = items.length, | |
namespaced = {}; | |
if ( l && namespace ) { | |
if ( !separator ) { | |
separator = "."; |
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
var getType = (function() { | |
var rFunctionName = /function ([^(]+)/; | |
return function( object ) { | |
var matches, | |
type = $.type( object ); | |
if ( type == "object" ) { | |
matches = rFunctionName.exec( object.constructor.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 getScrollBarWidth() { | |
var inner = document.createElement('p'); | |
inner.style.width = "100%"; | |
inner.style.height = "200px"; | |
var outer = document.createElement('div'); | |
outer.style.position = "absolute"; | |
outer.style.top = "0px"; | |
outer.style.left = "0px"; | |
outer.style.visibility = "hidden"; |