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
# Print Git commit statistics for a specific author | |
# Usage: git-stats "Linus Torvalds" | |
git-stats() { | |
author=${1-`git config --get user.name`} | |
echo "Commit stats for \033[1;37m$author\033[0m:" | |
git log --shortstat --author $author -i 2> /dev/null \ | |
| grep -E 'files? changed' \ | |
| awk 'BEGIN{commits=0;inserted=0;deleted=0} \ | |
{commits+=1; if($5!~"^insertion") { deleted+=$4 } \ |
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
var express = require('express'), | |
cgh = require('connect-githubhook'), | |
sites = {'/secret-update-url': {url: 'https://github.com/user/repo', | |
branch: 'master'}, | |
app = express.createServer(); | |
var handler = function(repo, payload) { | |
console.log('Code change detected. Restarting now...'); | |
setTimeout(function() { | |
process.exit(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
lo = require("lodash") | |
### | |
Similar to Ruby Array.wrap function | |
- if arg is already an array simply returns the arg | |
- otherwise returns argument wrapped in an Array | |
### | |
lo.mixin lo, { | |
arrayWrap: (val) -> | |
if lo.isArray(val) |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
node: { | |
fs: "empty" | |
} |
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
--languages=-javascript | |
--langdef=js | |
--langmap=js:.js | |
--langmap=js:+.jsx | |
// | |
// Constants | |
// | |
// A constant: AAA0_123 = { or AAA0_123: { |
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 getComputedStyle( dom ) { | |
var style; | |
var returns = {}; | |
// FireFox and Chrome way | |
if(window.getComputedStyle){ | |
style = window.getComputedStyle(dom, null); | |
for(var i = 0, l = style.length; i < l; i++){ | |
var prop = style[i]; | |
var val = style.getPropertyValue(prop); | |
returns[prop] = val; |
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
(Math.max.apply(Math, | |
$.makeArray($('*') | |
.map(function () { | |
return $(this).css('z-index'); | |
}).filter(function () { | |
return $.isNumeric(this); | |
}).map(function () { | |
return parseInt(this, 10); | |
})))); |
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
javascript:(function() {var e = document.getElementById('pull_request_body');if (e) {e.value += '# What? Why?\n\n\n# How was it tested?\n\n\ncc project_narhwal @mLewisLogic @clizzin @Raphomet @LogicWolfe';}})(); |
OlderNewer