Instantly share code, notes, and snippets.

View rails_ramp_up.txt
1. download and install virtual box
2. download and install ubuntu 16.04
3. setup rails
4. learn
View test_commands.txt
#Run all tests for this project
bundle exec rspec
#run single test
bundle exec rspec path/to/spec/file/thingie_spec.rb
#Useful switches
bundle exec rspec --format documentation (more output context)
bundle exec rspec --order random (tests should be able to pass in any order)
bundle exec rspec --profile (shows you slowest tests)
View working_with_popups.rb
a_popup_window = window_opened_by do
# click_button 'Open Login Window', which opens a popup
the_xpath = "//a[@id='open_popup_link']"
find(:xpath, the_xpath).click
within_window(a_popup_window) do
# are we focused on the popup?
expect(page).to have_selector(:xpath, "//h1[contains(text(), 'Text that appears in the H1 Tag')]")
popup_page_instance =
View expectations.txt
# does button exist and is enabled
expect(page).to have_button('Update')
# does button exist and is disabled
expect(page).to have_button('Update', disabled: true)
# does h1 contain both of the specified strings
expect(page).to have_selector(:xpath, "//h1[contains(text(), 'New') and contains(text(), 'Person')]")
# does an input field with id of dataFirstName.1 exist
View spec_template.rb
require 'spec_helper'
RSpec.feature 'TODO: describe your spec here' do
before(:each) do
@wait_time = Capybara.default_max_wait_time
Capybara.default_max_wait_time = 10
scenario 'TODO: describe your scenario here.', :js do
# TODO: your logic goes here
View DataAccessObject.cfc
encapsulation is good stuff
<cfset variables.dsn = '' />
<cffunction name="init">
<cfargument name="dsn" type="string" required="true" />
View burster_buster.ino
* wot
* water level & low temp alert
* status
* water level sensor
* works
* active buzzer
View chromium_on_pi_3.txt
sudo dpkg -i chromium-codecs-ffmpeg-extra_48.0.2564.82-0ubuntu0.
sudo dpkg -i chromium-browser-l10n_48.0.2564.82-0ubuntu0. chromium-browser_48.0.2564.82-0ubuntu0.
View three-led-array.pde
int timer = 100; // The higher the number, the slower the timing.
int ledPins[] = {
2, 3, 4
}; // an array of pin numbers to which LEDs are attached
int pinCount = 3; // the number of pins (i.e. the length of the array)
void setup() {
// the array elements are numbered from 0 to (pinCount - 1).
// use a for loop to initialize each pin as an output:
for (int thisPin = 0; thisPin < pinCount; thisPin++) {
View rando-blink.pde