Skip to content

Instantly share code, notes, and snippets.

Avatar

Aaron Evans fijiaaron

View GitHub Profile
View gist:4092214
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 Nov 20, 2012
Create a new bug in Quality Center using the OTA API
View CreateBug.cs
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 Dec 14, 2015
Formatted CSS output in ../css folder from Sublime SASS Build
View SASS.sublime-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 Dec 30, 2015
Using a mock payment processor
View using_mockpayment_processor.py
# 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 Mar 22, 2012
Utility for working with BigDecimal as money
View MoneyUtil.java
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 Nov 20, 2012
Run a TestSet in QualityCenter using the OTA API
View RunTestSet.cs
using System;
using TDAPIOLELib;
namespace oneshore.qcintegration.examples
{
class RunTestSet
{
public static void Main()
{
String qcUrl = "http://localhost:8080/qcbin";
View 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);
};
View powershell_rest_request_example_with_basic_auth.ps1
$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 Oct 23, 2017
ways to map a map in java
View MapMap.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);
}
View foo.1.rb
class Foo
# initialize instance variables
def initialize(bar="bar", baz="baz")
@bar = bar
@baz = baz
end
end