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
const widgets = require("widget"); | |
const timer = require("timer"); | |
var instance = 0; | |
var widget = widgets.Widget({ | |
label: "Mozilla website", | |
content: instance.toString(), | |
onClick: function() { | |
tabs.open("http://www.mozilla.org/"); | |
} |
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
# name an email address in all old commits. | |
# WARNING: Will change all your commit SHA1s. | |
# Based off of the script from here: | |
# http://coffee.geek.nz/how-change-author-git.html | |
git filter-branch -f --commit-filter ' | |
if [ "$GIT_COMMITTER_EMAIL" = "<OLDMAIL>" ]; | |
then | |
GIT_AUTHOR_EMAIL="<NEWMAIL>"; | |
git commit-tree "$@"; | |
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
#!/bin/bash | |
EXCLUDEDIR=${EXCLUDEDIR:-"env/*"} | |
COLOR=${COLOR:-always} | |
CONTEXT=${CONTEXT:-0} | |
grep -IiRn --exclude="$EXCLUDE" --exclude-dir="$EXCLUDEDIR" --color=$COLOR -C$CONTEXT "$1" * \ | |
| less -iFRX |
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
#!/usr/bin/python | |
from bottle import route, run, debug | |
import argparse | |
parser = argparse.ArgumentParser(description='Really simple remote logger.') | |
parser.add_argument('-n', '--name', default="localhost", help="Name of the host from which the server will start (default: %(default)s)") | |
parser.add_argument('-p', '--port', default=1234, type=int, help="Port the server will be listening (default: %(default)s)") | |
args = parser.parse_args() |
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
[extensions] | |
color = | |
pager = | |
hgext.mq = | |
[pager] | |
pager = LESS='FSRX' less | |
[diff] | |
git = true |
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 phrase = "the quick brown fox jumps over the lazy dog" | |
alert(phrase.replace(/ /g,'').split('').sort().join('')) |
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
.sender[type=normal][colornumber='0'] { color: #033 } | |
.sender[type=normal][colornumber='1'] { color: #699 } | |
.sender[type=normal][colornumber='2'] { color: #f33 } | |
.sender[type=normal][colornumber='3'] { color: #f60 } | |
.sender[type=normal][colornumber='4'] { color: #3D3242 } | |
.sender[type=normal][colornumber='5'] { color: #6600CC } | |
.sender[type=normal][colornumber='6'] { color: #2C6700 } | |
.sender[type=normal][colornumber='7'] { color: #154890 } | |
.sender[type=normal][colornumber='8'] { color: #6B78B4 } | |
.sender[type=normal][colornumber='9'] { color: #E47297 } |
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
// Add script to bottom of page | |
// Convert a JS Date object to an array of characters | |
function dateToArray(date) { | |
console.log("Converting date: " + date); | |
var a = []; | |
var s = date.toString().toUpperCase().split(" "); | |
// eg "FRI JUN 29 2012 16:22:59 GMT-0700 (PDT)" | |
var month = s[1], | |
day = s[2], |
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
for folder in `ls -1d */` | |
do | |
files=`find $folder -type f -name "*.js" -exec cat {} \; | wc -l` | |
echo "$files - $folder"; | |
done |
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
from BeautifulSoup import BeautifulSoup | |
import json | |
import sys | |
if len(sys.argv) < 2: | |
print sys.argv[0] + ' <input file>' | |
else: | |
in_file = sys.argv[1] | |
if len(sys.argv) < 3: | |
tag = 'div' |
OlderNewer