This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Google Analytics --> | |
<script> | |
window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date; | |
ga('create', 'UA-18040704-1', 'auto'); | |
ga('send', 'pageview'); | |
</script> | |
<script async src='https://www.google-analytics.com/analytics.js'></script> | |
<!-- End Google Analytics --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install these gems first: | |
# gem install 'google_custom_search_api' 'wolfram-alpha' 'imdb' 'wunderground' 'whois' 'sinatra' | |
require 'google_custom_search_api' | |
require 'wolfram-alpha' | |
require 'imdb' | |
require 'wunderground' | |
require 'whois' | |
require 'json' | |
require 'sinatra' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=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') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var re = /^(\d{4})[-\/\.]{0,1}(?:(?:(11|0?[469])[-\/\.]?([12]\d|30|0?[1-9]))|(?:(1[02]|0?[13578])[-\/\.]{0,1}([1-2]\d|3[01]|0?[1-9]))|(?:(0?2)[-\/\.]{0,1}(2[1-9]|1\d|0?[1-9])))$/; | |
// test | |
[ | |
// valid dates | |
'2012-4-21', | |
'2012-04-21', | |
'2012-5-1', | |
'2012-05-31', | |
'2012-11-21', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source :rubygems | |
# We are not loading Active Record, nor Active Resources etc. | |
# We can do this in any app by simply replacing the rails gem | |
# by the parts we want to use. | |
gem "actionpack", "~> 3.2" | |
gem "railties", "~> 3.2" | |
gem "tzinfo" | |
# Let's use thin |