Skip to content

Instantly share code, notes, and snippets.

View fijiaaron's full-sized avatar

Aaron Evans fijiaaron

View GitHub Profile
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebDriverBackedSelenium;
import org.openqa.selenium.firefox.FirefoxDriver;
import com.thoughtworks.selenium.Selenium;
public class SeleniumCheckboxExample {
public static void main(String[] args)
{
@fijiaaron
fijiaaron / CreateBug.cs
Created November 20, 2012 22:58
Create a new bug in Quality Center using the OTA API
using TDAPIOLELib;
namespace oneshore.QCIntegration.Examples
{
public class CreateBug
{
public static void Main()
{
String qcUrl = "http://localhost:8080/qcbin";
String qcDomain = "oneshore";
@fijiaaron
fijiaaron / SASS.sublime-build
Last active December 14, 2015 00:19
Formatted CSS output in ../css folder from Sublime SASS Build
{
"cmd": ["sass", "--update", "$file:${file_path}/../css/${file_base_name}.css", "--style", "expanded", "--stop-on-error", "--no-cache"],
"selector": "source.sass, source.scss",
"line_regex": "Line ([0-9]+):",
"osx":
{
"path": "/usr/local/bin:$PATH"
},
@fijiaaron
fijiaaron / using_mockpayment_processor.py
Last active December 30, 2015 13:28
Using a mock payment processor
# this is really just an interface, but python doesn't really have interfaces
class PaymentProcessor():
def make_payment(self, payment_info, amount):
raise NotImplementedError()
#any other helper methods & properties
# this technically implements payment processor, but doesn't do anything -- used for testing
class MockPaymentProcessor(PaymentProcessor):
@fijiaaron
fijiaaron / MoneyUtil.java
Created March 22, 2012 15:33
Utility for working with BigDecimal as money
import java.math.BigDecimal;
public class MoneyUtil {
public static int DECIMAL_PLACES = 2;
public static int ROUNDING = BigDecimal.ROUND_HALF_UP;
// convert
public static BigDecimal decimal(int value) {
@fijiaaron
fijiaaron / RunTestSet.cs
Created November 20, 2012 21:34
Run a TestSet in QualityCenter using the OTA API
using System;
using TDAPIOLELib;
namespace oneshore.qcintegration.examples
{
class RunTestSet
{
public static void Main()
{
String qcUrl = "http://localhost:8080/qcbin";
@fijiaaron
fijiaaron / drag_and_drop_helper.js
Created April 11, 2017 23:24 — forked from rcorreia/drag_and_drop_helper.js
drag_and_drop_helper.js
(function( $ ) {
$.fn.simulateDragDrop = function(options) {
return this.each(function() {
new $.simulateDragDrop(this, options);
});
};
$.simulateDragDrop = function(elem, options) {
this.options = options;
this.simulateEvent(elem, options);
};
$username = $(Get-ChildItem Env:USERNAME).value
$password = $(Get-ChildItem Env:PASSWORD).value
$credentials = "$username`:$password"
$encodedCredentials = `
[System.Convert]::ToBase64String( `
[System.Text.Encoding]::ASCII.GetBytes($credentials))
Invoke-WebRequest `
-Uri https://api.example.com/some/endpoint `
@fijiaaron
fijiaaron / MapMap.java
Last active October 23, 2017 15:45
ways to map a map in java
import java.util.Map;
public class MapMap
{
Map<String, String> map;
public static void map(Object key, Object value)
{
System.out.println(key + ":" + value);
}
@fijiaaron
fijiaaron / foo.1.rb
Created February 26, 2019 23:40
RubyAccessors created by fijiaaron - https://repl.it/@fijiaaron/RubyAccessors
class Foo
# initialize instance variables
def initialize(bar="bar", baz="baz")
@bar = bar
@baz = baz
end
end