stopBefore(document, 'getElementById')
stopBefore('document.getElementById') // the same as the previous
stopBefore(Element.prototype, 'removeChild')
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]].Timer = {}; | |
Timer.Frame = function(handler) { | |
// ... does what rAF(handler) would do | |
}; | |
Timer.Frame.prototype.cancel = function() { | |
// kills this Timer.Frame instance | |
}; |
List of features that are supported by Opera 12 but not by Opera 15 due to the switch to Blink/Chromium:
fixed as of August 19, 2013xhr.responseType = 'json'
Link
HTTP headerLink
HTTP header for stylesheets specifically- Pressing
Enter
when an element withtabindex
has focus should trigger a click - Fragment identifiers in
data:
URIs should be handled correctly - CSS gradients with transparency
- Accurate SVG rendering
- [`` where
foo.svg
is an SVG file that contains text looks terrible](https://code.google.com/p/chromium/issues/detail?id=33
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
hooks.method = function() { | |
if (supportTestPasses()) { | |
delete hooks.method; | |
return; | |
} | |
hooks.method = function () { | |
// current hook code here | |
} | |
return hooks.method(); | |
}; |
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 | |
# 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 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 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]); |
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 () { | |
'use strict'; | |
const o = { | |
f: function () { | |
console.log(a); | |
} | |
}; | |
const a = 'aaa'; | |
o.f(); | |
})(); |
First, you install ruby-build and chruby. ruby-build is a program that knows how to download and build different ruby versions. chruby manages $PATH
to control which ruby
gets invoked in your shell. They work completely independently.
sudo su
cd /usr/src
git clone https://github.com/sstephenson/ruby-build.git
cd ruby-build
./install.sh
cd -
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 | |
# 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 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
{ | |
"name": "MyApp", | |
"version": "0.0.1", | |
"private": true, | |
"main": "app/index.html", | |
"dependencies": { | |
"jquery": "jquery/jquery", | |
"angular": "1.3.0-beta.5", | |
"es6-shim": ">=0.8.0", | |
"bootstrap-sass-official": "~3.1.1", |
OlderNewer