git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git
cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
| class SimpleLinearRegression | |
| def initialize(xs, ys) | |
| @xs, @ys = xs, ys | |
| if @xs.length != @ys.length | |
| raise "Unbalanced data. xs need to be same length as ys" | |
| end | |
| end | |
| def y_intercept | |
| mean(@ys) - (slope * mean(@xs)) |
| import com.google.gson.Gson; | |
| import com.google.gson.JsonSyntaxException; | |
| import com.android.volley.AuthFailureError; | |
| import com.android.volley.NetworkResponse; | |
| import com.android.volley.ParseError; | |
| import com.android.volley.Request; | |
| import com.android.volley.Response; | |
| import com.android.volley.Response.ErrorListener; | |
| import com.android.volley.Response.Listener; |
| #!/usr/bin/env ruby | |
| class Grepr | |
| def initialize(options, pattern) | |
| @paths = [] | |
| @pattern = pattern | |
| @noregex = options.include?('n') | |
| @pattern = "'#{@pattern}'" if pattern.include?(' ') | |
| options.each_char do |opt| | |
| case opt |
| #!/bin/bash | |
| # | |
| # Report time to first byte for the provided URL using a cache buster to ensure | |
| # that we're measuring full cold-cache performance | |
| while (($#)); do | |
| echo $1 | |
| curl -so /dev/null -H "Pragma: no-cache" -H "Cache-Control: no-cache" \ | |
| -w "%{http_code}\tPre-Transfer: %{time_pretransfer}\tStart Transfer: %{time_starttransfer}\tTotal: %{time_total}\tSize: %{size_download}\n" \ | |
| "$1?`date +%s`" |
| #!/bin/sh | |
| set -e | |
| TIMEOUT=${TIMEOUT-60} | |
| APP_ROOT=/usr/local/rails/myapp | |
| PID=$APP_ROOT/log/unicorn.pid | |
| #RAILS_ENV=production | |
| RAILS_ENV=development | |
| CMD="bundle exec unicorn -D -c $APP_ROOT/config/unicorn.rb -E $RAILS_ENV" |
| #!/bin/bash | |
| # Backup database | |
| host='localhost' | |
| user='backup' | |
| passwd='secret' | |
| db_array=(dbname) | |
| bk_dir=/usr/local/backup | |
| for db in ${db_array[@]}; do |
homebrew + rbenv + ruby-build
Installation of homebrew.
ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"