- Introduction
- Definition
- Examples
- Links
| =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') |
| #!/usr/bin/env ruby | |
| # Sometimes, you realize you have really rubbish songs in your library for some reason. | |
| # This script allows you to get rid of them just by hitting ./mpd-delete-current-song.rb on your command line. | |
| # It will backup the file to TRASH, then remove it from MPD's library and finally skip to next song. | |
| # https://gist.github.com/1341895 | |
| require 'socket' | |
| require 'fileutils' |
| class ExampleCrawler < PoltergeistCrawler | |
| def crawl | |
| visit "https://news.ycombinator.com/" | |
| click_on "More" | |
| page.evaluate_script("window.location = '/'") | |
| end | |
| end | |
| ExampleCrawler.new.crawl |
| HTTP status code symbols for Rails | |
| Thanks to Cody Fauser for this list of HTTP responce codes and their Ruby on Rails symbol mappings. | |
| Status Code Symbol | |
| 1xx Informational | |
| 100 :continue | |
| 101 :switching_protocols | |
| 102 :processing |
Since modern.ie released vagrant boxes, it' no longer necessary to manually import the ova file to virtualbox, as mentioned here.
However, the guys at modern.ie didn't configured the box to work with WinRM. This how-to addresses that, presenting steps to proper repackage these boxes, adding WinRM support. Additionally configures chocolatey package manager and puppet provisioner.
For a tool, which executes a configurable command when a bluetooth device connects, see repository https://github.com/joleuger/bluetooth-manager. It can be used to play an icecast stream.
> apt-get install libpam-systemd
> apt-get install pulseaudio gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-tools mpv
> apt-get install bluetooth bluez bluez-tools bluez-firmware pulseaudio-module-bluetooth
> adduser audioclient
> vim /etc/shadow (remove password)
First, Create a folder inside of lib called seeds
Put your CSV file example.csv into the lib/seeds folder. In the example below, the file is called real_estate_transactions.csv
Make sure you've created a resource with the appropriate columns to match your seed data. The names don't have to match up.