Add this entry to your local .git/config
:
[remote "prod"]
url = amazon:/path/to/repo.git
fetch = +refs/heads/*:refs/remotes/amazon/*
import fontforge | |
import os.path | |
filename = 'the-filename' | |
basename, ext = os.path.splitext(filename) | |
desired_formats = ['otf', 'eot'] | |
font = fontforge.open(filename) | |
for desired_format in desired_formats: | |
font.generate('%s.%s' % (basename, desired_format)) |
/* String to Number */ | |
var hello = '1234' | |
parseInt(hello) // Use this when speed is a concern (see http://jsperf.com/parseint-vs-unary) | |
// 1234 | |
+hello // unary operator -- use this when file size is a concern | |
// 1234 | |
+hello++ // Converts `hello` to a number and adds 1 to it |
// Converts #hashtags, @usernames, and http://regularlin.ks | |
var tweet = 'Final day for the 2 @nvidia *INSTANT ACCESS* @PlanetSide2 #BetaKeys. RT: https://t.co/gKpxu1eY and/or Follow: http://t.co/3ryWGeEz to enter!'; | |
tweet = tweet | |
.replace(/(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig, '<a target=_blank href="$1">$1</a>') | |
.replace(/(^|\s)@(\w+)/g, '$1<a target=_blank href=//twitter.com/$2>@$2</a>') | |
.replace(/(^|\s)#(\w+)/g, '$1<a target=_blank href=//twitter.com/search?q=%23$2>#$2</a>'); | |
# curl -L https://raw.github.com/gist/3431015/bootstrap.sh | sh | |
USERNAME=$(id -un) | |
COMMON_PKGS="curl vim git zsh autojump tmux" | |
command_exists () { | |
type "$1" &> /dev/null ; | |
} | |
if command_exists apt-get ; then |
# Packages | |
sudo apt-get install curl vim git zsh autojump tmux python-gpgme g++ libssl-dev apache2-utils | |
# Dotfiles | |
git init | |
git remote add -f origin git://github.com/liamcurry/dotfiles.git | |
git submodule update --init --force | |
git config status.showuntrackedfiles no | |
chsh -s /bin/zsh |
/* This needs some work, and is probably pretty broken at the moment. Will come back to this later. */ | |
define([ | |
'underscore' | |
], function ( | |
_ | |
) { | |
console.log(this); | |
var root = this; |
Start/Restart/Stop MySQL
mysql.server [stop|start|restart]
Create a MySQL database
create database db_name;
cd ~ | |
sudo apt-get update | |
sudo apt-get install openjdk-7-jre-headless -y | |
wget https://github.com/elasticsearch/elasticsearch/archive/v0.20.1.tar.gz -O elasticsearch.tar.gz | |
tar -xf elasticsearch.tar.gz | |
rm elasticsearch.tar.gz | |
sudo mv elasticsearch-* elasticsearch | |
sudo mv elasticsearch /usr/local/share |
function EventEmitter() {} | |
EventEmitter.prototype.on = | |
EventEmitter.prototype.addListener = function (event, callback) { | |
this._events = this._events || {}; | |
this._events[event] = this._events[event] || []; | |
this._events[event].push(callback); | |
return this; | |
}; |