start new:
tmux
start new with session name:
tmux new -s myname
# | |
# NOTICE: The stop/restart tasks won't work properly due to a bug in the daemons gem | |
# unless you use the ghazel-daemons gem by putting this in your environment.rb file: | |
# | |
# config.gem "ghazel-daemons", :lib => "daemons" | |
# gem "ghazel-daemons" | |
# require "daemons" | |
# | |
# This will force-load the 'ghazel-daemons' gem and make sure it's used instead of | |
# the 'daemons' gem. It works even with the 'daemons' gem installed, so you won't |
#!/bin/sh | |
### BEGIN INIT INFO | |
# Provides: unicorn | |
# Required-Start: $local_fs $remote_fs mysql | |
# Required-Stop: $local_fs $remote_fs | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: unicorn initscript | |
# Description: Unicorn is an HTTP server for Rack application | |
### END INIT INFO |
class Matrix | |
IndexOverflow = Class.new(StandardError) | |
attr_reader :dims, :nrows, :ncols | |
def initialize(mm, nn) | |
@dims = [mm, nn] | |
@nrows = mm | |
@ncols = nn |
var collectionNames = db.getCollectionNames(), stats = []; | |
collectionNames.forEach(function (n) { stats.push(db[n].stats()); }); | |
stats = stats.sort(function(a, b) { return b['size'] - a['size']; }); | |
for (var c in stats) { print(stats[c]['ns'] + ": " + stats[c]['size'] + " (" + stats[c]['storageSize'] + ")"); } |
// XPath CheatSheet | |
// To test XPath in your Chrome Debugger: $x('/html/body') | |
// http://www.jittuu.com/2012/2/14/Testing-XPath-In-Chrome/ | |
// 0. XPath Examples. | |
// More: http://xpath.alephzarro.com/content/cheatsheet.html | |
'//hr[@class="edge" and position()=1]' // every first hr of 'edge' class |
# You don't need Fog in Ruby or some other library to upload to S3 -- shell works perfectly fine | |
# This is how I upload my new Sol Trader builds (http://soltrader.net) | |
# Based on a modified script from here: http://tmont.com/blargh/2014/1/uploading-to-s3-in-bash | |
S3KEY="my aws key" | |
S3SECRET="my aws secret" # pass these in | |
function putS3 | |
{ | |
path=$1 |