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
# config.ru | |
# | |
# The Heroku architecture is based on Thin, which is based on EventMachine. This means | |
# you can access the EventMachine API and make use of Thin's asynchronous extension to | |
# the rack API. | |
# | |
# This is a simple asynchronous rack backed app that will hold a request for 4 seconds | |
# and respond with "Hello". | |
# | |
# In theory an app structured like this should be able to handle a huge number of |
require 'sunspot_ext/resque_session_proxy' | |
require 'sunspot_ext/resque_index_job' | |
Sunspot.session = Sunspot::ResqueSessionProxy.new(Sunspot.session) |
#inside RSpec.configure | |
config.before :all do | |
SunspotTest.stub | |
end | |
config.before(:all, search: true) do | |
SunspotTest.setup_solr | |
Sunspot.remove_all! | |
Sunspot.commit |
#!/bin/bash | |
# | |
# matrix: matrix-ish display for Bash terminal | |
# Author: Brett Terpstra 2012 <http://brettterpstra.com> | |
# Contributors: Lauri Ranta and Carl <http://blog.carlsensei.com/> | |
# | |
# A morning project. Could have been better, but I'm learning when to stop. | |
### Customization: | |
blue="\033[0;34m" |
Look at the following image...
...it shows an object being tested.
You can't see inside the object. All you can do is send it messages. This is an important point to make because we should be "testing the interface, and NOT the implementation" - doing so will allow us to change the implementation without causing our tests to break.
# activerecord-3.0.0/lib/active_record/connection_adapters/mysql_adapter.rb | |
# Maps logical Rails types to MySQL-specific data types. | |
def type_to_sql(type, limit = nil, precision = nil, scale = nil) | |
return super unless type.to_s == 'integer' | |
case limit | |
when 1; 'tinyint' | |
when 2; 'smallint' | |
when 3; 'mediumint' | |
when nil, 4, 11; 'int(11)' # compatibility with MySQL default |
upstream myapp_puma { | |
server unix:/tmp/myapp_puma.sock fail_timeout=0; | |
} | |
# for redirecting to https version of the site | |
server { | |
listen 80; | |
rewrite ^(.*) https://$host$1 permanent; | |
} | |
gem 'devise', '3.2.4' | |
gem 'simple_token_authentication', '1.5.0' |
# Easy way to check for dependencies | |
checkfor () { | |
command -v $1 >/dev/null 2>&1 || { | |
echo >&2 "$1 required"; | |
exit 1; | |
} | |
} | |
checkfor "ffmpeg" | |