Skip to content

Instantly share code, notes, and snippets.

View christophervigliotti's full-sized avatar
🎯
Hi

Christopher Vigliotti christophervigliotti

🎯
Hi
View GitHub Profile
#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)
@christophervigliotti
christophervigliotti / working_with_popups.rb
Created April 20, 2018 13:54
AFT Working With Popups
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
end
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 = PopupPageObj.new
@christophervigliotti
christophervigliotti / expectations.txt
Last active April 20, 2018 13:52
AFT Expectations Reference
# 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
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
end
scenario 'TODO: describe your scenario here.', :js do
# TODO: your logic goes here
@christophervigliotti
christophervigliotti / DataAccessObject.cfc
Last active April 20, 2018 13:42
A brief meditation on encapsulation in ColdFusion
<!---
encapsulation is good stuff https://en.wikipedia.org/wiki/Encapsulation_(computer_programming)
--->
<cfcomponent>
<cfset variables.dsn = '' />
<cffunction name="init">
<cfargument name="dsn" type="string" required="true" />
@christophervigliotti
christophervigliotti / burster_buster.ino
Last active April 20, 2018 13:43
An Arduino project that my son and I collaborated on.
/*
* wot
* water level & low temp alert
*
* status
* water level sensor
* https://www.fasttech.com/p/3809800
* works
* active buzzer
* https://www.fasttech.com/p/1219302
@christophervigliotti
christophervigliotti / chromium_on_pi_3.txt
Created April 8, 2016 22:49
Install Chromium on Raspberry Pi 3
wget http://ports.ubuntu.com/pool/universe/c/chromium-browser/chromium-browser-l10n_48.0.2564.82-0ubuntu0.15.04.1.1193_all.deb
wget http://ports.ubuntu.com/pool/universe/c/chromium-browser/chromium-browser_48.0.2564.82-0ubuntu0.15.04.1.1193_armhf.deb
wget http://ports.ubuntu.com/pool/universe/c/chromium-browser/chromium-codecs-ffmpeg-extra_48.0.2564.82-0ubuntu0.15.04.1.1193_armhf.deb
sudo dpkg -i chromium-codecs-ffmpeg-extra_48.0.2564.82-0ubuntu0.15.04.1.1193_armhf.deb
sudo dpkg -i chromium-browser-l10n_48.0.2564.82-0ubuntu0.15.04.1.1193_all.deb chromium-browser_48.0.2564.82-0ubuntu0.15.04.1.1193_armhf.deb
@christophervigliotti
christophervigliotti / three-led-array.pde
Created December 7, 2015 02:10
Three LED Array PEW PEW!
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
christophervigliotti / rando-blink.pde
Created December 7, 2015 01:34
An Obnoxious Blinky LED Sketch
@christophervigliotti
christophervigliotti / jessie_needs_chromium.txt
Created November 25, 2015 14:30
Install Latest Chromium On Debian Jessie
wget http://ftp.us.debian.org/debian/pool/main/libg/libgcrypt11/libgcrypt11_1.5.0-5+deb7u3_armhf.deb
wget http://launchpadlibrarian.net/218525709/chromium-browser_45.0.2454.85-0ubuntu0.14.04.1.1097_armhf.deb
wget http://launchpadlibrarian.net/218525711/chromium-codecs-ffmpeg-extra_45.0.2454.85-0ubuntu0.14.04.1.1097_armhf.deb
sudo dpkg -i libgcrypt11_1.5.0-5+deb7u3_armhf.deb
sudo dpkg -i chromium-codecs-ffmpeg-extra_45.0.2454.85-0ubuntu0.14.04.1.1097_armhf.deb
sudo dpkg -i chromium-browser_45.0.2454.85-0ubuntu0.14.04.1.1097_armhf.deb
# via http://conoroneill.net/running-the-latest-chromium-45-on-debian-jessie-on-your-raspberry-pi-2/