This file contains hidden or 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 hidden or 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
| #!/bin/bash | |
| #debian R upgrade | |
| echo "deb http://streaming.stat.iastate.edu/CRAN/bin/linux/debian lenny-cran/" | sudo tee -a /etc/apt/sources.list | |
| sudo apt-get update | |
| sudo apt-get -t lenny-cran install --yes --force-yes r-base r-base-dev | |
This file contains hidden or 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
| .libPaths("~/Rpackages") | |
| library(lattice) | |
| library(XML) | |
| library(RCurl) | |
| library(RLastFM) | |
| library(cimis) | |
| options(error = recover, repos = "http://cran.cnr.Berkeley.edu") |
This file contains hidden or 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
| require 'yaml' | |
| require 'logger' | |
| require 'active_record' | |
| namespace :db do | |
| def create_database config | |
| options = {:charset => 'utf8', :collation => 'utf8_unicode_ci'} | |
| create_db = lambda do |config| | |
| ActiveRecord::Base.establish_connection config.merge('database' => nil) |
This file contains hidden or 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
| toSeconds <- function(x){ | |
| if (!is.character(x)) stop("x must be a character string of the form H:M:S") | |
| if (length(x)<=0)return(x) | |
| unlist( | |
| lapply(x, | |
| function(i){ | |
| i <- as.numeric(strsplit(i,':',fixed=TRUE)[[1]]) | |
| if (length(i) == 3) | |
| i[1]*3600 + i[2]*60 + i[3] |
This file contains hidden or 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
| require 'active_record' | |
| ActiveRecord::Base.logger = Logger.new(STDERR) | |
| ActiveRecord::Base.colorize_logging = false | |
| ActiveRecord::Base.establish_connection( | |
| :adapter => "sqlite3", | |
| :dbfile => ":memory:" | |
| ) |
This file contains hidden or 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
| # MySQL. Versions 4.1 and 5.0 are recommended. | |
| # | |
| # Install the MySQL driver: | |
| # gem install mysql2 | |
| # | |
| # And be sure to use new-style password hashing: | |
| # http://dev.mysql.com/doc/refman/5.0/en/old-client.html | |
| development: | |
| adapter: mysql2 | |
| encoding: utf8 |
This file contains hidden or 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
| web: bundle exec unicorn -p $PORT -c ./config/unicorn.rb |
This file contains hidden or 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
| #!/bin/bash | |
| # Restarts Pow when DNS fails to resolve | |
| lsof | grep 20560 | awk '{print $2}' | xargs kill -9 | |
| launchctl unload ~/Library/LaunchAgents/cx.pow.powd.plist | |
| launchctl load ~/Library/LaunchAgents/cx.pow.powd.plist |
This file contains hidden or 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
| require "rubygems" | |
| require "json" | |
| require "net/http" | |
| require "uri" | |
| uri = URI.parse("http://api.sejmometr.pl/posiedzenia/BZfWZ/projekty") | |
| http = Net::HTTP.new(uri.host, uri.port) | |
| request = Net::HTTP::Get.new(uri.request_uri) |
OlderNewer