Skip to content

Instantly share code, notes, and snippets.

View tathamoddie's full-sized avatar

Tatham Oddie tathamoddie

View GitHub Profile
//An Array of dataTables to to them from other controls
var dataTables = new Array ( );
function CreateDateTable ( controlID, headers, initialDataSource )
{
//Retrieve Table Properties to pass
//from the Parent Control to the rendered Table (DIV)
var renderedControl = document.getElementById ( controlID );
var tableCaption = renderedControl.getAttribute ( "_Caption" );
@tathamoddie
tathamoddie / Dodgy.css
Created September 3, 2010 04:09
The very definition of completely retarded CSS
/********** Widths */
.WidthInherit {width: inherit;}
.Width01, input[type="text"].Width01, input[type="password"].Width01, textarea.Width01 {width: 10px;}
.Width02, input[type="text"].Width02, input[type="password"].Width02, textarea.Width02 {width: 20px;}
.Width03, input[type="text"].Width03, input[type="password"].Width03, textarea.Width03 {width: 30px;}
.Width04, input[type="text"].Width04, input[type="password"].Width04, textarea.Width04 {width: 40px;}
.Width05, input[type="text"].Width05, input[type="password"].Width05, textarea.Width05 {width: 50px;}
.Width06, input[type="text"].Width06, input[type="password"].Width06, textarea.Width06 {width: 60px;}
.Width07, input[type="text"].Width07, input[type="password"].Width07, textarea.Width07 {width: 70px;}
.Width08, input[type="text"].Width08, input[type="password"].Width08, textarea.Width08 {width: 80px;}
@tathamoddie
tathamoddie / gist:589179
Created September 21, 2010 04:17
Analysis of some interesting regular expressions
^1?$|^(11+?)\1+$
Tokens:
^ StartOfStringAssertion
1 Literal
? Quantifier
$ EndOfStringAssertion
| OrOperator
^ StartOfStringAssertion
[Reflection.Assembly]::Load('Microsoft.TeamFoundation.VersionControl.Client, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a') | Out-Null
$WorkstationType = [Microsoft.TeamFoundation.VersionControl.Client.Workstation]
$WorkspaceInfo = $WorkstationType::Current.GetLocalWorkspaceInfo($FilePath)
$Collection = [Microsoft.TeamFoundation.Client.TfsTeamProjectCollectionFactory]::GetTeamProjectCollection($WorkspaceInfo.ServerUri)
$Workspace = $WorkspaceInfo.GetWorkspace($Collection)
$Workspace.PendEdit($FilePath)
#requires -Version 2
[CmdletBinding()]
param ()
$ErrorActionPreference = "Stop"
Set-PSDebug -Strict
$PSScriptFilePath = (Get-Item $MyInvocation.MyCommand.Path).FullName
$PSScriptRoot = Split-Path $PSScriptFilePath -Parent
@tathamoddie
tathamoddie / gist:621348
Created October 11, 2010 22:35 — forked from jstangroome/gist:621345
PowerShell script to test if ASP.NET padding security patch is applied
Set-StrictMode -Version Latest
[Reflection.Assembly]::Load('System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a') | Out-Null
$PatchedMethod = [System.Web.Configuration.MachineKeySection].GetMethods('NonPublic, Public, Static') |
Where-Object {
$LastParameter = $_.GetParameters() | Select-Object -Last 1
$_.Name -eq 'EncryptOrDecryptData' -and
$LastParameter -ne $null -and
$LastParameter.ParameterType -eq [bool] -and
[TestMethod]
public void TestMethod1()
{
// Arrange
var uriThatThrows400 = new Uri("http://www.asp.net/<script>", true);
var request = (HttpWebRequest)WebRequest.CreateDefault(uriThatThrows400);
try
{
// Act
public class Foo
{
readonly int bar;
public Foo(int bar)
{
this.bar = bar;
}
public override bool Equals(object obj)
C:\Users\tatham.oddie>nslookup
Default Server: UnKnown
Address: 2001:dfb:0:b00b::10
> thomasjo.com
Server: UnKnown
Address: 10.0.0.150
Non-authoritative answer:
Name: thomasjo.com
<!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.