Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
# Recursively diff two hashes, showing only the differing values. | |
# By Henrik Nyh <http://henrik.nyh.se> 2009-07-14 under the MIT license. | |
# | |
# Example: | |
# | |
# a = { | |
# "same" => "same", | |
# "diff" => "a", | |
# "only a" => "a", | |
# "nest" => { |
=Navigating= | |
visit('/projects') | |
visit(post_comments_path(post)) | |
=Clicking links and buttons= | |
click_link('id-of-link') | |
click_link('Link Text') | |
click_button('Save') | |
click('Link Text') # Click either a link or a button | |
click('Button Value') |
<html> | |
<head> | |
<script type="text/javascript" src="http://canvg.googlecode.com/svn/trunk/rgbcolor.js"></script> | |
<script type="text/javascript" src="http://canvg.googlecode.com/svn/trunk/canvg.js"></script> | |
<script> | |
function getImgData(chartContainer) { | |
var chartArea = chartContainer.getElementsByTagName('iframe')[0]. | |
contentDocument.getElementById('chartArea'); | |
var svg = chartArea.innerHTML; | |
var doc = chartContainer.ownerDocument; |
Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
#Model | |
@user.should have(1).error_on(:username) # Checks whether there is an error in username | |
@user.errors[:username].should include("can't be blank") # check for the error message | |
#Rendering | |
response.should render_template(:index) | |
#Redirecting | |
response.should redirect_to(movies_path) |
# First, make sure that you have the most recent rvm. Several bugs with 2.0.0-preview1 | |
# have recently been fixed. | |
# | |
# Second, the openssl that comes with MacOS is too old for Ruby 2.0. You need to install | |
# a newer one with homebrew or the rvm pkg command. | |
# Option 1, with homebrew openssl: | |
brew update | |
brew install openssl |
I'm having trouble understanding the benefit of require.js. Can you help me out? I imagine other developers have a similar interest.
From Require.js - Why AMD:
The AMD format comes from wanting a module format that was better than today's "write a bunch of script tags with implicit dependencies that you have to manually order"
I don't quite understand why this methodology is so bad. The difficult part is that you have to manually order dependencies. But the benefit is that you don't have an additional layer of abstraction.
if [ -f "$rvm_path/scripts/rvm" ]; then | |
source "$rvm_path/scripts/rvm" | |
if [ -f ".rvmrc" ]; then | |
source ".rvmrc" | |
fi | |
if [ -f ".ruby-version" ]; then | |
rvm use `cat .ruby-version` | |
fi |
# To Setup: | |
# 1) Save the .git-completion.bash file found here: | |
# https://github.com/git/git/blob/master/contrib/completion/git-completion.bash | |
# 2) Add the following lines to your .bash_profile, be sure to reload (for example: source ~/.bash_profile) for the changes to take effect: | |
# Git branch bash completion | |
if [ -f ~/.git-completion.bash ]; then | |
. ~/.git-completion.bash | |
# Add git completion to aliases |