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 ( undefined ) { | |
console.log( '0: ' + undefined ); | |
})( 0 ); // => 0 | |
(function ( undefined ) { | |
'use strict'; | |
console.log( '1: ' + undefined ); | |
})( 1 ); // => 1 | |
(function () { |
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
hooks.method = function() { | |
if (supportTestPasses()) { | |
delete hooks.method; | |
return; | |
} | |
hooks.method = function () { | |
// current hook code here | |
} | |
return hooks.method(); | |
}; |
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 | |
# Show the sorted list of tickets fixed between 2 given commits. | |
if [ $# -ne 2 ]; then | |
echo "USAGE: `basename $0` commit1id commit2id" | |
exit 1 | |
fi | |
git log --ancestry-path $1..$2 | egrep -i 'fix|fixes|fixed' | grep '#' | cut -f2 -d'#' | awk '{ printf "%d\n", $1 }' | sort |
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 () { | |
'use strict'; | |
const o = { | |
f: function () { | |
console.log(a); | |
} | |
}; | |
const a = 'aaa'; | |
o.f(); | |
})(); |
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 | |
# Usage: move this file to ~/bin/ and create a link ~/bin/psa-full -> psa. | |
# `psa STRING` will show you the output clipped to current number of columns in | |
# the terminal, `psa-full STRING` will give the full output. | |
# Tested on OS X 10.9-10.10. | |
if [[ "`basename "$0"`" == *-full ]]; then | |
COLS=10000 | |
else |
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 tickets = [ | |
// List of tickets to migrate. | |
"http://bugs.jquery.com/ticket/XXXX", | |
"http://bugs.jquery.com/ticket/YYYY", | |
]; | |
var request = require('request'), | |
jsdom = require('jsdom'), | |
apiPrefix = 'https://api.github.com/repos/jquery/jquery/'; |
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
// The diff between the following two definitions has one line: `+c: 3,`: | |
var o1 = { | |
a: 1, | |
b: 2, | |
}; | |
var o1 = { | |
a: 1, | |
b: 2, | |
c: 3, | |
}; |
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
import template from './my-dummy.html'; | |
import './my-dummy.scss'; | |
const deps = new WeakMap(); | |
class MyDummyController { | |
constructor($timeout, $q) { | |
'ngInject'; | |
deps.set(this, {$timeout, $q}); | |
} |
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
<div class="grid"> | |
<div class="replaced"></div> | |
<span class="green"></span> | |
<span class="red"></span> | |
</div> |
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 ngAppElem = angular.element(document.querySelector('[ng-app]') || document); | |
window.$injector = ngAppElem.injector(); | |
window.inject = $injector.invoke; | |
window.$rootScope = ngAppElem.scope(); | |
// getService('auth') will create a variable `auth` assigned to the service `auth`. | |
var getService = serviceName => | |
inject([serviceName, s => window[serviceName] = s]); |
OlderNewer