Given an integer, and a range of integers (both positive and negative) as input.
We need to calculate the possible combinations of the integers from the range that add up to the given integer.
For example:
Integer: 5
Range: -1, 0, 1, 2, 3, 4
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc | |
. ~/.bashrc | |
mkdir ~/local | |
mkdir ~/node-latest-install | |
cd ~/node-latest-install | |
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1 | |
./configure --prefix=~/local | |
make install # ok, fine, this step probably takes more than 30 seconds... | |
curl https://www.npmjs.org/install.sh | sh |
Given an integer, and a range of integers (both positive and negative) as input.
We need to calculate the possible combinations of the integers from the range that add up to the given integer.
For example:
Integer: 5
Range: -1, 0, 1, 2, 3, 4
# NOTICE: to get Nginx+Unicorn best-practices configuration see the gist https://gist.github.com/3052776 | |
$ cd /usr/src | |
$ wget http://nginx.org/download/nginx-1.2.1.tar.gz | |
$ tar xzvf ./nginx-1.2.1.tar.gz && rm -f ./nginx-1.2.1.tar.gz | |
$ wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.30.tar.gz | |
$ tar xzvf pcre-8.30.tar.gz && rm -f ./pcre-8.30.tar.gz | |
$ wget http://www.openssl.org/source/openssl-1.0.1c.tar.gz |
# generic install and usage of rhc | |
# install rhc gem | |
export RB_USER_INSTALL=true | |
export PATH=$PATH:/home/holly/.gem/ruby/1.8/bin | |
gem install --user-install --source http://gems.rubyforge.org --source https://openshift.redhat.com/app/repo/ rhc | |
# json-1.5.1 | |
# parseconfig-0.5.2 | |
# rhc-0.69.3 |
# autoload concerns | |
module YourApp | |
class Application < Rails::Application | |
config.autoload_paths += %W( | |
#{config.root}/app/controllers/concerns | |
#{config.root}/app/models/concerns | |
) | |
end | |
end |
/** | |
* ## Merging mixin views in backbone.js ## | |
* | |
* really just more a test for tumblr gistr | |
*/ | |
/** | |
* Merge the mixin (a Backbone.View) into another Backbone.View. Automatically merge events, defaults, and call the parent initializer. | |
**/ | |
function mergeMixin(view, mixin) { |
#!/usr/bin/env ruby | |
require "rubygems" | |
gem "minitest" | |
require "minitest/autorun" | |
require "minitest/pride" | |
class Palindrome | |
def search string | |
@array = string.gsub(/[^0-9a-z ]/i, '').gsub(' ', '').downcase.split '' | |
@palindromes = [] |
# First install tmux | |
brew install tmux | |
# For mouse support (for switching panes and windows) | |
# Only needed if you are using Terminal.app (iTerm has mouse support) | |
Install http://www.culater.net/software/SIMBL/SIMBL.php | |
Then install https://bitheap.org/mouseterm/ | |
# More on mouse support http://floriancrouzat.net/2010/07/run-tmux-with-mouse-support-in-mac-os-x-terminal-app/ |
namespace :assets do | |
desc "Check that all assets have valid encoding" | |
task :check => :environment do | |
paths = ["app/assets", "lib/assets", "vendor/assets"] | |
extensions = ["js", "coffee", "css", "scss"] | |
paths.each do |path| | |
dir_path = Rails.root + path |