This file contains 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
beforeEach(module(function ($provide) { | |
$provide.decorator('$window', ['$delegate', | |
function ($delegate) { | |
$windowMock = {}; | |
$windowMock.prototype = $delegate; | |
$windowMock.reloadCount = 0; | |
$windowMock.location = {}; | |
$windowMock.location.reload = function () { | |
$windowMock.reloadCount = $windowMock.reloadCount + 1; | |
}; |
This file contains 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
// override the $window.open to count usage and prevent | |
// new windows from opening when running karma in watch mode | |
beforeEach(module(function ($provide) { | |
newWindow = { | |
location: {}, | |
focusCalled: false, | |
closeCount: 0, | |
focus: function () { | |
newWindow.focusCalled = true; | |
}, |
This file contains 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
afterEach(function () { | |
$httpBackend.verifyNoOutstandingExpectation(); | |
$httpBackend.verifyNoOutstandingRequest(); | |
}); |
This file contains 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
{ | |
"close_windows_when_empty": false, | |
"color_scheme": "Packages/User/Monokai Extended (SL).tmTheme", | |
"font_face": "consolas", | |
"font_size": 15, | |
"ignored_packages": | |
[ | |
"Vintage", | |
"Markdown" | |
], |
This file contains 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
# from http://brettterpstra.com/2013/02/09/quick-tip-jumping-to-the-finder-location-in-terminal/ | |
# cd to the path of the front Finder window | |
cdf() { | |
target=`osascript -e 'tell application "Finder" to if (count of Finder windows) > 0 then get POSIX path of (target of front Finder window as text)'` | |
if [ "$target" != "" ]; then | |
cd "$target"; pwd | |
else | |
echo 'No Finder window found' >&2 | |
fi | |
} |
This file contains 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
# list commands | |
le = log --oneline --decorate | |
ll = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --numstat | |
ls1 = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate | |
lds = log --pretty=format:"%C(yellow)%h\\ %C(green)%ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=short --graph | |
ls = log --pretty=format:"%C(green)%h\\ %C(yellow)[%ad]%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=relative |
This file contains 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
/* Vertical (column) Flex Container for actions | |
-------------------------------------------------- */ | |
.fc-col { | |
display: flex; | |
flex-direction: column; | |
flex-wrap: nowrap; | |
justify-content: flex-start; | |
align-content: stretch; | |
align-items: stretch; |
This file contains 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 stringFill2(x, n) { | |
var s = ''; | |
while (n-- > 0) s += x; | |
return s; | |
} |
This file contains 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
#!/usr/local/bin/node | |
var cp = require('child_process'); | |
module.paths.push('/usr/local/lib/node_modules'); // hacky hacky hacky to get to async | |
var async = require('async'); | |
var getJsFiles = 'git diff --cached --name-only --diff-filter=ACM | grep ".js$"'; | |
cp.exec(getJsFiles, function (err, stdout, stderr) { | |
var failCount = 0; |
This file contains 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
#!/bin/sh | |
if git-rev-parse --verify HEAD >/dev/null 2>&1; then | |
against=HEAD | |
else | |
against=4b825dc642cb6eb9a060e54bf8d69288fbee4904 | |
fi | |
jsfiles=$(git diff --cached --name-only --diff-filter=ACM | grep ".js$") | |
if [ "$jsfiles" = "" ]; then |