(C-x means ctrl+x, M-x means alt+x)
The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf
:
# Installs ruby1.8 ruby1.9 ruby1.9.1 found on Lucid as alternatives. Easily switch between them. | |
# Originally from: http://groups.google.com/group/rails-oceania/browse_thread/thread/8a2b256d117db49f | |
# become root | |
su | |
# make sure the packages are installed for 1.8 & 1.9 | |
aptitude install -s ~n^ruby1.[89]$ ~n^irb1.[89]$ ~n^ri1.[89] | |
# install ruby1.8 & friends with priority 500 |
#!/usr/bin/ruby | |
require 'yaml' | |
ROOT_PATH = File.expand_path(File.join(File.dirname(__FILE__), '..')) | |
ENV_DEFAULTS = { | |
'ruby_path' => (r = `which ruby`.strip).empty? ? '/usr/bin/ruby' : r, | |
'env_path' => (r = `which env`.strip).empty? ? '/usr/bin/env' : r, | |
'cwd' => ROOT_PATH |
*~ | |
~* | |
*# | |
#* | |
.#* | |
.gitignore | |
*.swp | |
*.swo | |
.sass-cache | |
log |
# split mp3 files in 5 secs interval, -n -x strip tags on the resulting mp3 files. | |
mp3splt -t 0.5 -n -x demo.mp3 |
require 'pp' | |
OPS = [ '+', '-', '*', '/' ] | |
def generate_combos(n, &block) | |
n_len = n.length | |
chars = n_to_chars_with_pads(n) | |
OPS[0..0].each_index do |ops_i| | |
transform(chars, n_len, 0, ops_i, &block) |
## Context | |
Two dataset.import() calls happen on the same table. | |
## Stack trace | |
/home/rubydev/.rvm/gems/ruby-1.9.3-p484/gems/sequel-4.18.0/lib/sequel/database/logging.rb:58:in `query': Mysql2::Error: Deadlock found when trying to get lock; try restarting transaction (Sequel::SerializationFailure) | |
from /home/rubydev/.rvm/gems/ruby-1.9.3-p484/gems/sequel-4.18.0/lib/sequel/database/logging.rb:58:in `block in log_connection_execute' | |
from /home/rubydev/.rvm/gems/ruby-1.9.3-p484/gems/sequel-4.18.0/lib/sequel/database/logging.rb:33:in `log_yield' | |
from /home/rubydev/.rvm/gems/ruby-1.9.3-p484/gems/sequel-4.18.0/lib/sequel/database/logging.rb:58:in `log_connection_execute' |
I hereby claim:
To claim this, I am signing this object:
module WordCount where | |
import Data.Char | |
import Data.List | |
import Data.Map (fromList) | |
wordCount s = fromList $ map (\s -> (head s, length s)) $ groupByWords s | |
normCase :: String -> String | |
normCase s = [ toLower x | x <- s ] |
-- Shamelessly stolen from: | |
-- https://www.cs.york.ac.uk/ftpdir/pub/haskell/contrib/Roman.hs | |
module Roman (numerals) where | |
import Data.Maybe (fromJust, fromMaybe) | |
numerals n = Just $ toRoman n | |
numH = [ ('I', 1), ('V', 5), ('X', 10), ('L', 50), |