Skip to content

Instantly share code, notes, and snippets.

View adiel's full-sized avatar

Adrian Hawkins-Longley adiel

View GitHub Profile
@adiel
adiel / embedMatches.html
Created April 15, 2012 09:57
Add this to the welcome message to embed upcoming fixtures and recent results on your play-cricket homepage
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script><style>#inner-column-main .apl h2{font-size: 1.3em;margin: 0.5em 0;} .apl_spinner{display:block;}</style><div id="apl_fixtures" class="apl"></div><div id="apl_results" class="apl"></div><script>jQuery(function(){var a=16,b=16,c=function(a,b,c){var d={startDay:b.getDate(),startMonth:b.getMonth()+1,startYear:b.getFullYear(),endDay:c.getDate(),endMonth:c.getMonth()+1,endYear:c.getFullYear()};return"/scoreboard/"+a+".asp?seasonID=&fromForm=1&quickSearch=QS1&startDay="+d.startDay+"&startMonth="+d.startMonth+"&startYear="+d.startYear+"&endDay="+d.endDay+"&endMonth="+d.endMonth+"&endYear="+d.endYear+"&type=&team="},d=function(a,b){return c("fixtures",a,b)},e=function(a,b){return c("results",a,b)},f=function(a){var b;b="\n \r";for(var c=32;c<127;c++)b+=c==91||c==92|c==93||c==94?"\\"+String.fromCharCode(c):String.fromCharCode(c);b="["+b+"]";var d=new RegExp(b,"g");return a.match(d).join("")},g=function(a,b,c){jQuery(b).append($("<h2>
@adiel
adiel / CustomDependencies.cs
Created April 4, 2012 14:13
Register custom scenario-scoped dependencies in SpecFlow - Coypu example
using BoDi;
using Coypu;
using OpenQA.Selenium;
using TechTalk.SpecFlow;
namespace SpecflowContainerContext
{
[Binding]
public class Hooks
{
@adiel
adiel / CoypuCustomProfile.cs
Created January 27, 2012 11:37
Using a custom firefox profile with Coypu
[Test]
public void CustomProfile()
{
Configuration.Driver = typeof (CustomFirefoxProfileSeleniumWebDriver);
Browser.Session.Visit("https://www.relishapp.com/");
}
public class CustomFirefoxProfileSeleniumWebDriver : SeleniumWebDriver
{
function EbnfDiagram(gc,width,height) {
this.gc = gc;
this.styles = STYLES;
this.style = this.styles["DIAGRAM"];
this.height = height;
this.width = width;
this.init();
}
@adiel
adiel / RestrictedFilesSpike.cs
Created July 13, 2011 12:19
Spike downloading files from behind login with Coypu
using System;
using System.IO;
using System.Net;
using Coypu;
using OpenQA.Selenium.Remote;
namespace Itv.BB.Bloom.Web.CMSSite.AcceptanceTests.Migration.Support
{
public static class CoypuExtensions
{