Skip to content

Instantly share code, notes, and snippets.

View tathamoddie's full-sized avatar

Tatham Oddie tathamoddie

View GitHub Profile
$(function() {
var tagIndex = 0;
$('span[tag]')
.each(function() {
var target = $(this);
var tag = target.attr('tag');
target.data(
'template',
$.templates('tag' + tagIndex, '${' + tag + '}'));
GET /mahtweets/graph HTTP/1.1
User-Agent: Fiddler
Host: hg01.codeplex.com
HTTP/1.1 502 Bad Gateway
Content-Type: text/html
Server: Microsoft-IIS/7.5
X-Powered-By: ASP.NET
Date: Tue, 03 Aug 2010 11:58:33 GMT
one-time step:
notepad %userprofile%\.hgrc
type in:
[ui]
username = Steve Godbold <[email protected]>
### TFS 2008 can't copy a file without breaking the history, which just baffles me ###
### This is how Hg does it: ####
D:\temp>mkdir HgCopyTest
D:\temp>cd HgCopyTest
D:\temp\HgCopyTest>hg init
D:\temp\HgCopyTest>echo Hello there > A.txt
@tathamoddie
tathamoddie / Swap unique values.sql
Created August 5, 2010 01:36
Swap two values in SQL that have a unique constraint
SET NOCOUNT ON
CREATE TABLE Foo
(
Id int primary key,
SortIndex int unique
)
GO
@tathamoddie
tathamoddie / RequiresPowerShell.bat
Created August 5, 2010 03:48
Batch file to automatically detect, download and install PowerShell 2 on to an XP SP3 machine
@echo off
REM If PowerShell 2 is not installed, this script will automatically download and install it.
REM Only works on XP SP3 with .NET 3.5. Only for dev boxes, not designed for servers.
REM Based on http://blog.codeassassin.com/2009/12/10/no-web-browser-need-powershell/
ver | find "XP" > nul
if %ERRORLEVEL% neq 0 goto not_xp
ver | find "5.1.2600" > nul
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
#container
{
width: 900px;
overflow: hidden;
padding: 0;
background: #000;