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
| # http://www.spoj.com/problems/TEST/ | |
| guess = STDIN.gets.chomp().to_i | |
| while guess != 42 | |
| puts guess | |
| guess = STDIN.gets.chomp().to_i | |
| end |
| require 'json' | |
| require 'net/http' | |
| require 'rubygems' | |
| staffs = %w(weesun knmnyn wgx731 Leventhan franklingu Limy Muhammad-Muneer) | |
| baseurl = "http://osrc.dfm.io/" | |
| # Construct the json URLs | |
| def construct_urls(base_url, usernames, suffix) | |
| urls = Array.new |
| // integration using Simpson's Law | |
| function calc_integral (func, a, b, n) { | |
| var h = (b - a) / n; | |
| function helper (func, acc, k) { | |
| if (k === n) { | |
| if (k % 2 === 0) { | |
| return (acc + 2 * func(a + k * h)); | |
| } else { | |
| return (acc + 4 * func(a + k * h)); |
| #!/bin/sh | |
| git log --diff-filter=D --summary | |
| git checkout $commit~1 filename |
| array = [ | |
| {:name=>"site a", :url=>"http://example.org/site/1/"}, | |
| {:name=>"site b", :url=>"http://example.org/site/2/"}, | |
| {:name=>"site c", :url=>"http://example.org/site/3/"}, | |
| {:name=>"site d", :url=>"http://example.org/site/1/"}, | |
| {:name=>"site e", :url=>"http://example.org/site/2/"}, | |
| {:name=>"site f", :url=>"http://example.org/site/6/"}, | |
| {:name=>"site g", :url=>"http://example.org/site/1/"} | |
| ] |
| descriptions = {} | |
| # ======== | |
| # KEYWORDS | |
| # ======== | |
| # ----- | |
| # alias | |
| # ----- |
| source 'http://rubygems.org' | |
| gem 'rails', '3.1.0' | |
| # Bundle edge Rails instead: | |
| # gem 'rails', :git => 'git://github.com/rails/rails.git' | |
| gem 'sqlite3' | |
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