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
// ==UserScript== | |
// @name Anti-AstroPad | |
// @version 0.01 | |
// @grant GM_xmlhttpRequest | |
// @grant GM_addStyle | |
// @match http://mush.vg/* | |
// @match http://mush.vg/# | |
// @match http://mush.twinoid.com/* | |
// @match http://mush.twinoid.com/# | |
// @match http://mush.twinoid.es/* |
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/bash | |
# Downloads and applies a patch from Drupal.org. | |
if [ -z "$1" ] | |
then | |
echo "You need to supply a URL to a patch file." | |
exit | |
fi | |
URL=$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
// A simple object with some methods, | |
// which throw errors when bad arguments are passed. | |
var maths = { | |
square : function (value) { | |
// Validity checking | |
if (arguments.length !== 1) { | |
throw new Error('square: Requires one and only one argument'); | |
} | |
if (typeof value !== 'number') { | |
throw new Error('square: Requires numeric argument'); |
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 hang(n) { | |
var x = new XMLHttpRequest(); | |
x.open('GET', 'http://hang.nodester.com/script.js?' + n, false); | |
x.send(); | |
} | |
// usage: hang(2 * 1000); |
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
[alias] | |
# View the SHA, description, and history graph of the latest 20 commits | |
l = log --pretty=oneline -n 10 --graph | |
# Better, prettier log view (including author and relative date) | |
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative | |
# View the current working tree status using the short format | |
s = status -s | |
# Diff | |
d = diff --patch-with-stat | |
# Diff, inline |
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
/* | |
Chrome does not let you modify the keyCode prop when you trigger it, so it defaults to 0. | |
You can use this code to trigger a keydown with a char code of 0 in chrome. | |
If you use initKeyEvent instead of initKeyboardEvent, it will work in FF | |
(the bellow example would trigger keydown with a char code of 65 in FF). | |
*/ | |
document.addEventListener( 'keydown', function( event ){ | |
console.log( event.keyCode ) |
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
/** | |
* Copyright(c) 2011 Andrée Hansson | |
* @peolanha | |
* http://github.com/peol | |
* | |
* License: Do whatever you want, some attribution would be nice | |
* | |
* Small, versatile relative time function, options: | |
* asArray: Returns the data in an array, each entry has [0] = number, [1] = string representation | |
* filterValues: Removes all entries with 0 as value |