Skip to content

Instantly share code, notes, and snippets.

View tathamoddie's full-sized avatar

Tatham Oddie tathamoddie

View GitHub Profile
<!doctype html>
<html>
<head>
<title>Fade Test</title>
</head>
<body>
<p>
When you click this text it should fade out over one second, then back in over one second.
Works perfectly in Firefox, Chrome, Opera and IE8.
@echo off
powershell.exe -command "$ErrorActionPreference='Stop'; & '%~dpn0.ps1' %*"
exit /b %ERRORLEVEL%
@tathamoddie
tathamoddie / IE9 geolocation hit
Created February 10, 2011 22:51
IE 9 geo service lookup from Sydney airport
POST /inferenceservice/v21/Pox/GetLocationUsingFingerprint HTTP/1.1
Accept: */*
Accept-Language: en-au
Content-Type: text/xml
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)
Host: inference.location.live.net
Content-Length: 1205
Connection: Keep-Alive
Cache-Control: no-cache
@tathamoddie
tathamoddie / gist:823260
Created February 11, 2011 23:30
IE 9 geo service lookup from 35,000ft over Texas
POST /inferenceservice/v21/Pox/GetLocationUsingFingerprint HTTP/1.1
Accept: */*
Accept-Language: en-au
Content-Type: text/xml
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)
Host: inference.location.live.net
Content-Length: 1756
Connection: Keep-Alive
Cache-Control: no-cache
using System;
using System.Collections.Generic;
using System.Web.Mvc;
using System.Web.Security;
using Facebook;
using MyFacebookSite3434.Models;
namespace MyFacebookSite3434.Controllers
{
public class AccountController : Controller
var testHarness = new TestHarness();
var consoleTestProcessor = new ConsoleTestProcessor();
testHarness.Processors.Add(consoleTestProcessor);
var fileSystemTestProcessor = new FileSystemTestProcessor();
fileSystemTestProcessor.AddMockFile(@"c:\foo.txt", "bar");
testHarness.Processors.Add(fileSystemTestProcessor);
var dateTimeProcessor = new DateTimeProcessor(new DateTime(2010, 01, 25));
public class WorkerEntryPoint : RoleEntryPoint
{
public override bool OnStart()
{
WaitForWindowsAzureDiagnosticsInfrastructureToCatchUp();
try
{
Trace.WriteLine("Worker role starting");
@tathamoddie
tathamoddie / markup.html
Created July 8, 2011 02:11
One color to rule them all.
<div id="foo"><div class="bar">Baz</div></div>
@tathamoddie
tathamoddie / DictionaryExtensions.cs
Created July 14, 2011 05:16
Thread safe GetValue with initializer
namespace SnowMaker
{
static class DictionaryExtensions
{
internal static TValue GetValue<TKey, TValue>(
this IDictionary<TKey, TValue> dictionary,
TKey key,
object dictionaryLock,
Func<TValue> valueInitializer)
{
p {
text-decoration: underline;
color: red;
}
p::selection {
background-color: yellow;
color: black;
}
p last:abbr {
font-weight: bold;