Skip to content

Instantly share code, notes, and snippets.

View fijiaaron's full-sized avatar

Aaron Evans fijiaaron

View GitHub Profile
@fijiaaron
fijiaaron / TestRunner.cs
Created November 22, 2011 23:52
Running NUnit tests programmatically
using System;
using NUnit.Core;
using NUnit.Framework.Constraints;
namespace oneshore.qa.testrunner
{
class TestRunner
{
public static void Main(String[] args)
{
@fijiaaron
fijiaaron / checklinks.php
Created December 21, 2011 23:51
Check a list of URLs for content using PHP & CURL
@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) {
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 / 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 / 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 / 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 `