As configured in my dotfiles.
start new:
tmux
start new with session name:
| #!/usr/bin/env ruby -w | |
| ## Using ruby's standard OptionParser to get subcommand's in command line arguments | |
| ## Note you cannot do: opt.rb help command | |
| ## other options are commander, main, GLI, trollop... | |
| # run it as | |
| # ruby opt.rb --help | |
| # ruby opt.rb foo --help | |
| # ruby opt.rb foo -q | |
| # etc |
| require 'active_record' | |
| ActiveRecord::Base.logger = Logger.new(STDERR) | |
| ActiveRecord::Base.colorize_logging = false | |
| ActiveRecord::Base.establish_connection( | |
| :adapter => "sqlite3", | |
| :dbfile => ":memory:" | |
| ) |
| >> IF = -> b { b } | |
| => #<Proc:0x007fb4e4049cc8 (lambda)> | |
| >> LEFT = -> p { p[-> x { -> y { x } } ] } | |
| => #<Proc:0x007fb4e403d680 (lambda)> | |
| >> RIGHT = -> p { p[-> x { -> y { y } } ] } | |
| => #<Proc:0x007fb4e4028ff0 (lambda)> | |
| >> IS_EMPTY = LEFT |
As configured in my dotfiles.
start new:
tmux
start new with session name:
| #!/bin/sh | |
| # Quick start-stop-daemon example, derived from Debian /etc/init.d/ssh | |
| set -e | |
| # Must be a valid filename | |
| NAME=foo | |
| PIDFILE=/var/run/$NAME.pid | |
| #This is the command to be run, give the full pathname | |
| DAEMON=/usr/local/bin/bar |
| # source: http://st-on-it.blogspot.com/2010/01/how-to-move-folders-between-git.html | |
| # First of all you need to have a clean clone of the source repository so we didn't screw the things up. | |
| git clone git://server.com/my-repo1.git | |
| # After that you need to do some preparations on the source repository, nuking all the entries except the folder you need to move. Use the following command | |
| git filter-branch --subdirectory-filter your_dir -- -- all | |
| # This will nuke all the other entries and their history, creating a clean git repository that contains only data and history from the directory you need. If you need to move several folders, you have to collect them in a single directory using the git mv command. |
| # From http://garmoncheg.blogspot.com/2012/06/pretty-git-log.html | |
| git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --" |
Look at LSB init scripts for more information.
Copy to /etc/init.d:
# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)