Skip to content

Instantly share code, notes, and snippets.

Christopher Vigliotti christophervigliotti

View GitHub Profile
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 =
christophervigliotti / expectations.txt
Last active Apr 20, 2018
AFT Expectations Reference
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
christophervigliotti / DataAccessObject.cfc
Last active Apr 20, 2018
A brief meditation on encapsulation in ColdFusion
View DataAccessObject.cfc
encapsulation is good stuff
<cfset variables.dsn = '' />
<cffunction name="init">
<cfargument name="dsn" type="string" required="true" />
christophervigliotti / burster_buster.ino
Last active Apr 20, 2018
An Arduino project that my son and I collaborated on.
View burster_buster.ino
* wot
* water level & low temp alert
* status
* water level sensor
* works
* active buzzer
christophervigliotti / chromium_on_pi_3.txt
Created Apr 8, 2016
Install Chromium on Raspberry Pi 3
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++) {
christophervigliotti / rando-blink.pde
Created Dec 7, 2015
An Obnoxious Blinky LED Sketch
View rando-blink.pde
You can’t perform that action at this time.