This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
| #!/usr/local/bin/ruby | |
| # Creates a new repo called ARGV[0] | |
| @args = ARGV | |
| @args.each_with_index{|o,i| puts "#{i} : #{o}"} | |
| if not @args[1] =~ /(private|public)/ | |
| puts "invalid arguments: #{@args.inspect}" | |
| exit(1) |
| pretty colour code for headers | |
| #474747 |
| # PostgreSQL. Versions 7.4 and 8.x are supported. | |
| # | |
| # Install the pg driver: | |
| # gem install pg | |
| # On Mac OS X with macports: | |
| # gem install pg -- --with-pg-config=/opt/local/lib/postgresql84/bin/pg_config | |
| # On Windows: | |
| # gem install pg | |
| # Choose the win32 build. | |
| # Install PostgreSQL and put its /bin directory on your path. |
| http://nyan-mode.buildsomethingamazing.com/ |
This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
| # This should be Markdown'd |
| install ruby deps from sauce | |
| sudo apt-get install build-essential libssl-dev libreadline5-dev zlib1g-dev |
| A. Catalogue - form of data store | |
| B. Data flow, catalogue info | |
| C. Lookup "Price" for "StockID" - Process | |
| D. Data flow - StockID | |
| E. Data store - price list | |
| F. Returns "Price" | |
| G. Process - Process payment | |
| H. Re-order file - Data store |
| # now override it | |
| module Sass | |
| module Version | |
| def version | |
| @@version = { | |
| :major => 3, | |
| :minor => 2, | |
| :teeny => 0, | |
| :name => nil | |
| } |
| require 'simple_worker' | |
| class EncodePhoto < SimpleWorker::Base | |
| merge_gem 'zencoder' | |
| attr_accessor :photo_id, :unencoded_url | |
| # The run method is what SimpleWorker calls to run your worker | |
| def run | |
| begin |