Skip to content

Instantly share code, notes, and snippets.

View alexglow's full-sized avatar

Alex Glow alexglow

View GitHub Profile
#include <SPI.h>
#include <Wire.h>
#include <Scout.h>
#include <GS.h>
#include <bitlash.h>
#include <lwm.h>
#include <js0n.h>
#include <Servo.h>
Servo myservo; // create servo object to control a servo
EXAMPLE BUTTON-PUSH PROGRAM FROM JEREMIE
function color { led.setrgb(r,g,b); }; // The function to set the LED to a color
function rotate { r = random(255); g = random(255); b = random(255); color; }; // The function to generate a color and set the LED to it
function startup { pin.makeinputup(2); run rotate,1000; }; // On startup, make digital pin 2 a button. Set the LED to a random color once a second.
function event.button2 { stop *; color; led.gethex("happy"); }; // When button is pushed, stop everything. Set the LED to a random color. Get the current LED color and feed it into function "happy".
@alexglow
alexglow / gist:9184944
Last active August 29, 2015 13:56
Sauce test with Selenium relay
import unittest
from selenium import webdriver
from time import sleep
class Selenium2OnSauce(unittest.TestCase):
def setUp(self):
desired_capabilities = webdriver.DesiredCapabilities.INTERNETEXPLORER
desired_capabilities['platform'] = 'Windows 2008'
desired_capabilities['version'] = '9'
@alexglow
alexglow / desired-caps
Created November 20, 2013 22:10
example Desired Capabilities section of a Java test
@BeforeClass
public static void setupDriver() throws MalformedURLException {
DesiredCapabilities caps = DesiredCapabilities.firefox();
caps.setCapability("version", "17");
caps.setCapability("platform", "Windows 7");
caps.setCapability("name", "Google test");
//caps.setCapability("tunnel-identifier", "BagEnd");
driver = new RemoteWebDriver(new URL("http://" + sauceUser + ":" + sauceKey + "@ondemand.saucelabs.com:80/wd/hub"),
@alexglow
alexglow / one
Created November 13, 2013 21:08
error messages from hitting enter during tapster connection
Sauces-MacBook-Air:src sauce$ node bot.js
1384376401637 Board Connecting...
1384376401728 Serial Found possible serial port /dev/cu.usbmodem1411
1384376401729 Board -> Serialport connected /dev/cu.usbmodem1411
1384376403729 Repl Initialized
>> 1384376405145 Board <- Serialport ready /dev/cu.usbmodem1411
string_decoder.js:109
charStr += buffer.toString(this.encoding, 0, end);
@alexglow
alexglow / error-messages
Last active January 31, 2018 22:57
This is a list of errors you may encounter when testing in Sauce Labs, as well as the usual causes and how to fix them. The list is under construction and will soon be made available on the Sauce Labs website, but it's here for now so that you can find it when Googling!
Search for the error message you're seeing. Then read what we have to say about it. Then fix it! If you still have problems, write in to [email protected] .
==== AUTOMATED JOB ERRORS: ====
-- Invalid credentials --
Some combination of the following error messages will be thrown:
OpenQA.Selenium.WebDriverException : Unexpected error. Unknown username.
You sent username 'None' in your browser string, which is not a valid Sauce Labs account.
OpenQA.Selenium.WebDriverException : Unexpected error. Invalid Credentials.
org.openqa.selenium.UnsupportedCommandException: Invalid Credentials.
@alexglow
alexglow / thoreau - walden
Created January 6, 2013 23:55
happy new year!
No man ever followed his genius till it misled him. Though the result were bodily weakness, yet perhaps no one can say that the consequences were to be regretted, for these were a life in conformity to higher principles. If the day and night are such that you greet them with joy, and life emits a fragrance like flowers and sweet-scented herbs, is more elastic, more starry, more immortal, -- That is your success. All nature is your congratulation, and you have cause momentarily to bless yourself. The greatest gains and values are farthest from being appreciated. We easily come to doubt if they exist. We soon forget them. They are the highest reality.
@alexglow
alexglow / avoidproxy-se1.php
Created August 21, 2012 01:17
wat have i done
<?php
require_once 'PHPUnit/Extensions/SeleniumTestCase/SauceOnDemandTestCase.php';
/**
* // The following line makes the class 'ExampleTest' run its tests in parallel.
* // PHP can read it even though it lives in a comment.
* // Read more at http://blog.fedecarg.com/2008/07/19/using-annotations-in-php/
*
* @runTestsInParallel 10