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 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
source 'http://rubygems.org' | |
gem 'rails', '3.1.0' | |
# Bundle edge Rails instead: | |
# gem 'rails', :git => 'git://github.com/rails/rails.git' | |
gem 'sqlite3' | |
descriptions = {} | |
# ======== | |
# KEYWORDS | |
# ======== | |
# ----- | |
# alias | |
# ----- |
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/"} | |
] |
#!/bin/sh | |
git log --diff-filter=D --summary | |
git checkout $commit~1 filename |
// 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)); |
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 |
# http://www.spoj.com/problems/TEST/ | |
guess = STDIN.gets.chomp().to_i | |
while guess != 42 | |
puts guess | |
guess = STDIN.gets.chomp().to_i | |
end |
#!/bin/sh | |
# Modified code from original at http://iphonedevwiki.net/index.php/Xcode#Automatically_installing_apps_on_your_device_wirelessly_when_they_are_built_in_Xcode | |
# Modify this to your device's IP address. | |
IP="192.168.1.67" | |
osascript -e 'display notification "Updating app on iPhone" with title "Xcode"' | |
# Verify that the build is for iOS Device and not a Simulator. | |
if [ "$NATIVE_ARCH" == "armv7" ]; then |
class User | |
PROPERTIES = [:id, :name, :email] | |
PROPERTIES.each { |prop| | |
attr_accessor prop | |
} | |
def initialize(attributes = {}) | |
attributes.each { |key, value| | |
self.send("#{key}=", value) if PROPERTIES.member? key | |
} |