Skip to content

Instantly share code, notes, and snippets.

View davidwhitney's full-sized avatar
🍸
You're all wonderful. That's what's happening.

David Whitney davidwhitney

🍸
You're all wonderful. That's what's happening.
View GitHub Profile
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:Boolean x:Key="/Default/CodeEditing/Intellisense/CodeCompletion/IntelliSenseCompletingCharacters/CSharpCompletingCharacters/UpgradedFromVSSettings/@EntryValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/ExcludedFiles/FileMasksToSkip/=_002A_002Emin_002Ejs/@EntryIndexedValue">True</s:Boolean>
<s:String x:Key="/Default/CodeStyle/CodeCleanup/RecentlyUsedProfile/@EntryValue">Default: Full Cleanup</s:String>
<s:Boolean x:Key="/Default/CodeStyle/Generate/=Implementations/@KeyIndexDefined">True</s:Boolean>
<s:String x:Key="/Default/CodeStyle/Generate/=Implementations/Options/=PropertyBody/@EntryIndexedValue">Default body (from options)</s:String>
<s:Boolean x:Key="/Default/Environment/ExternalSources/FirstTimeFormShown/
@davidwhitney
davidwhitney / AmazonWebDriverExample-Bad.cs
Created April 1, 2015 15:32
Horrible web driver code
[TestFixture]
public class AmazonWebDriverExample
{
private RemoteWebDriver _selenim;
[SetUp]
public void Setup()
{
_selenim = new PhantomJSDriver();
}
@davidwhitney
davidwhitney / PassengerExample.cs
Last active August 29, 2015 14:18
Passenger webdriver example
[TestFixture]
public class PassengerExample
{
private PassengerConfiguration _testConfig;
private PageObjectTestContext<AmazonHomepage> _ctx;
[SetUp]
public void Setup()
{
@davidwhitney
davidwhitney / RetryAndTests.cs
Created April 14, 2015 12:41
Retry example
using System;
using System.Collections.Generic;
using System.Linq;
using NUnit.Framework;
namespace ClassLibrary1
{
[TestFixture]
public class Class1
{
using System;
using System.Collections.Generic;
using System.Linq;
using NUnit.Framework;
namespace triangle
{
public class Pascal
{
public static string GenerateNicely(int maxDepth)
@davidwhitney
davidwhitney / WebForms view engine with device detection
Created October 6, 2010 13:57
MVC2 view engine that detects devices
using System.Collections.Generic;
using System.Web.Mvc;
using System;
using System.Globalization;
using System.Linq;
// Resolving view engine is reflected out from the default WebFormsViewEngine
// with extra hooks for a resolver
// device detection makes use of http://mdbf.codeplex.com/ and query string magic
@davidwhitney
davidwhitney / HtmlHelperExtensions.cs
Created November 15, 2010 15:15
Html Helper extension for pluralization
using System;
using System.Globalization;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Web.Mvc;
namespace Extensions
{
public static class HtmlHelperExtensions
@davidwhitney
davidwhitney / HelloJustGivingPHPSdk.php
Created November 22, 2010 17:27
PHP example of a "Hello world" app for account creation, page creation, page retrieval
<?php
include_once 'JustGivingClient.php';
include_once 'ApiClients/Model/CreateAccountRequest.php';
function WriteLine($string)
{
echo $string . "<br/>";
}
$ApiLocation = "https://api.staging.justgiving.com/";
@davidwhitney
davidwhitney / Feature set concept
Created December 23, 2010 10:39
Feature set concept
namespace featuerset
{
public class SomeConsumingClass
{
public void RenderEndUserAccountView()
{
var configService = new ServiceThatBringsBackFeatures();
var featureConfig = configService.GetFeatures("RaceForLife");
if(!featureConfig.Features.EndUserAccount.EmailTool.Enabled)
@davidwhitney
davidwhitney / JustGivingUsingNodeJs
Created January 6, 2011 22:16
A quick Node.js example for accessing the JustGiving API
var sys = require('sys'), http = require('http');
http.createServer(function (req, res) {
var user = 'david+publicexample@justgiving.com';
var password = 'password';
var auth = new Buffer(user + ':' + password).toString('base64');
var client = http.createClient(80, 'api.staging.justgiving.com', true);
var request = client.request('GET', '/decbf1d2/v1/fundraising/pages/nodejs-example/donations', {