start new:
tmux
start new with session name:
tmux new -s myname
| /* | |
| * Use this to turn on logging: (in your local extensions file) | |
| */ | |
| Handlebars.logger.log = function(level) { | |
| if(level >= Handlebars.logger.level) { | |
| console.log.apply(console, [].concat(["Handlebars: "], _.toArray(arguments))); | |
| } | |
| }; | |
| // DEBUG: 0, INFO: 1, WARN: 2, ERROR: 3, |
| // This script sets OSName variable as follows: | |
| // "Windows" for all versions of Windows | |
| // "MacOS" for all versions of Macintosh OS | |
| // "Linux" for all versions of Linux | |
| // "UNIX" for all other UNIX flavors | |
| // "Unknown OS" indicates failure to detect the OS | |
| var OSName="Unknown OS"; | |
| if (navigator.appVersion.indexOf("Win")!=-1) OSName="Windows"; | |
| if (navigator.appVersion.indexOf("Mac")!=-1) OSName="MacOS"; |
| from django.core.files.uploadhandler import TemporaryFileUploadHandler | |
| from django.core.files.base import File | |
| from dropbox.client import DropboxClient | |
| from dropbox.session import DropboxSession | |
| from django.conf import settings | |
| import os | |
| class DropboxFileUploadHandler(TemporaryFileUploadHandler): | |
| def __init__(self, *args, **kwargs): | |
| super(DropboxFileUploadHandler, self).__init__(*args, **kwargs) |
| #!/usr/bin/env bash | |
| curl https://s3.amazonaws.com/heroku-jvm-buildpack-vi/vim-7.3.tar.gz --output vim.tar.gz | |
| mkdir vim && tar xzvf vim.tar.gz -C vim | |
| export PATH=$PATH:/app/vim/bin |
| #!/usr/bin/env python | |
| import os | |
| import re | |
| import subprocess | |
| import sys | |
| modified = re.compile('^[MA]\s+(?P<name>.*)$') | |
| CHECKS = [ |
| #!/usr/bin/env ruby | |
| # Usage: gitio URL [CODE] | |
| # | |
| # Turns a github.com URL | |
| # into a git.io URL | |
| # | |
| # Copies the git.io URL to your clipboard. | |
| url = ARGV[0] | |
| code = ARGV[1] |
| var mongo = require('mongoskin'); | |
| var db = mongo.db('127.0.0.1:27017/test'); | |
| // create index: | |
| // key, unique, callback | |
| db.collection('user').ensureIndex([['name', 1]], true, function(err, replies){}); | |
| // bind method: db.user ===> db.collection('user') | |
| db.bind('user'); |
| require 'active_record' | |
| ActiveRecord::Base.logger = Logger.new(STDERR) | |
| ActiveRecord::Base.colorize_logging = false | |
| ActiveRecord::Base.establish_connection( | |
| :adapter => "sqlite3", | |
| :dbfile => ":memory:" | |
| ) |