# change mirror to ubuntu.osuosl.org first
sudo apt-get update
sudo apt-get install build-essential libreadline-dev libssl-dev zlib1g-dev libxml2-dev libxslt-dev
| #!/bin/bash | |
| # Script for installing tmux on systems where you don't have root access. | |
| # tmux will be installed in $HOME/local/bin. | |
| # It's assumed that wget and a C/C++ compiler are installed. | |
| # exit on error | |
| set -e | |
| TMUX_VERSION=1.8 |
Locate the section for your github remote in the .git/config file. It looks like this:
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = git@github.com:joyent/node.git
Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:
| echo -e "\e[1;40m" ; clear ; while :; do echo $LINES $COLUMNS $(( $RANDOM % $COLUMNS)) $(( $RANDOM % 72 )) ;sleep 0.05; done|awk '{ letters="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#$%^&*()"; c=$4; letter=substr(letters,c,1);a[$3]=0;for (x in a) {o=a[x];a[x]=a[x]+1; printf "\033[%s;%sH\033[2;32m%s",o,x,letter; printf "\033[%s;%sH\033[1;37m%s\033[0;0H",a[x],x,letter;if (a[x] >= $1) { a[x]=0; } }}' |
| # http://www.dzone.com/snippets/build-hash-tree-array-file | |
| Dir["**/*"].inject({}) {|h,i| t = h; i.split("/").each {|n| t[n] ||= {}; t = t[n]}; h} |
I 'm fleshing out some of these ideas here: https://github.com/lynaghk/todoFRP/tree/master/todo/angular-cljs
| # Place in config/initializers | |
| ActiveRecord::Base.class_eval do | |
| class << self | |
| def inherited_with_strong_params(sub) | |
| inherited_without_strong_params(sub) | |
| # Filter out plugin models that won't work with strong_parameters yet | |
| unless sub.name =~ /^doorkeeper/i | |
| sub.send :include, ActiveModel::ForbiddenAttributesProtection | |
| end | |
| end |
| source :rubygems | |
| gem 'sinatra', '~> 1.3.3' | |
| gem 'json', '~> 1.7.5' | |
| gem 'restforce', '~> 1.0.5' | |
| gem 'thin', '~> 1.5.0' | |
| group :development do | |
| gem 'shotgun', '~> 0.9' | |
| gem 'tunnels', '~> 1.2.2' |
| # Assuming you champioin your other DB connection with a class. | |
| module OtherDb | |
| class Connection < ActiveRecord::Base | |
| establish_connection :other_db | |
| self.abstract_class = true | |
| end | |
| end | |
| # Alway use the connection for other/legacy connections. |
Jim Weirich:
This is how I explain it… Ruby has Procs and Lambdas. Procs are created with
Proc.new { }, lambdas are created withlambda {}and->() {}.
In Ruby 1.8,
proc {}creates lambda, and Ruby 1.9 it creates procs (don't ask).
Lambdas use method semantics when handling parameters, procs use assignment semantics when handling parameters.
This means lambdas, like methods, will raise an ArgumentError when called with fewer arguments than they were defined with. Procs will simply assign nil to variables for arguments that were not passed in.