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] | |
fix = "!vim `git diff --name-only --diff-filter=U`" | |
co = checkout | |
l = log --decorate --graph --pretty='format:%C(auto)%h %s, %d%n🙇 %Cgreen%aN %Cred%ar (%aI)%n' --color --date-order | |
lg = log --pretty=oneline --abbrev-commit | |
la = log --all --date-order --decorate --graph --pretty='format:%C(auto)%h %s, %d%n🙇 %Cgreen%aN %Cred%ar (%aI)%n' --color | |
all = l --all --simplify-by-decoration | |
ba = "!f() { \ | |
git for-each-ref --format='%(committerdate) %09 %(authorname) %09 %(refname)' | sort -k5n -k2M -k3n -k4n; \ | |
}; f" |
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
#! /bin/sh | |
alias today='date "+DATE: %Y-%m-%d%nTIME: %H:%M:%S %Z"' | |
if hash ggrep 2>/dev/null; then | |
alias grep='ggrep --color=auto -n -P' | |
fi | |
alias get='git grep --color=auto -n -P' | |
unset work |
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
// js-test now supports lazily printing test results which dumps all test | |
// results once at the end of the test instead of building them up. To enable | |
// this option, call setPrintTestResultsLazily() before running any tests. | |
var _lazyTestResults; // Set by setPrintTestResultsLazily(). | |
// svg/dynamic-updates tests set enablePixelTesting=true, as we want to dump text + pixel results | |
if (self.testRunner) { | |
if (self.enablePixelTesting) | |
testRunner.dumpAsTextWithPixelResults(); | |
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
/*global self*/ | |
/*jshint latedef: nofunc*/ | |
/* | |
Distributed under both the W3C Test Suite License [1] and the W3C | |
3-clause BSD License [2]. To contribute to a W3C Test Suite, see the | |
policies and contribution forms [3]. | |
[1] http://www.w3.org/Consortium/Legal/2008/04-testsuite-license | |
[2] http://www.w3.org/Consortium/Legal/2008/03-bsd-license | |
[3] http://www.w3.org/2004/10/27-testcases |
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
fs = require('fs') | |
[ | |
KEY, | |
VALUE, | |
OBJECT_START, | |
OBJECT_END, | |
ARRAY_START, | |
ARRAY_END, | |
ASSIGN |
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
# number lines for all javascript files | |
find . -type f \( -name "*.js" -or -name "*.jsx" \) \ | |
! -path "./node_modules/*" ! -path "./vendor/*" \ | |
! -path "./generated-public/*" \ | |
! -path "./design/*" \ | |
! -path "./test/*" \ | |
! -path "./app/statics/*" -print | xargs -L 1 wc -l | awk '{s+=$1} END {print s}' |
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
set runtimepath^=~/.vim runtimepath+=~/.vim/after | |
let &packpath = &runtimepath | |
set nocompatible " be iMproved, required | |
filetype off " required | |
" set the runtime path to include Vundle and initialize | |
set rtp+=~/.vim/bundle/Vundle.vim/ | |
let path='~/vimfiles/bundle' | |
call vundle#begin(path) |
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
/** | |
* matchFilter | |
* @param {Object} term - key:val pairs that model need to match | |
* @returns {boolean} | |
*/ | |
Backbone.Model.prototype.matchFilter = function (conditions) { | |
return _.every(conditions, function (val, key) { | |
return this.get(key) === val; | |
}, this); |
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
/** | |
* get remaining time | |
* @param {string} start - UTC/ISO time string | |
* @param {string} end - UTC/ISO time string | |
*/ | |
function getRemainingTime(start, end) { | |
start = moment(start), end = moment(end); | |
var now = moment(); | |
if (now > end) { |
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 log = console.log.bind(console); | |
/** | |
* Given a ad | |
* calculate max bid rate | |
*/ | |
function calculate_max_bid_rate(ad) { | |
var org_chain = get_org_chain(ad); |