Skip to content

Instantly share code, notes, and snippets.

// Compile using:
// csc /target:winexe /noconfig /define:DEBUG FinalizerDemo.cs /r:System.dll /r:System.Windows.Forms.dll
// Self-contained demonstration code for:
// http://stackoverflow.com/questions/792660/is-gc-suppressfinalize-guaranteed
using WikiPad;
using System;
using System.Windows.Forms;
using System.Collections.Generic;
public class TransformedResult
{
public IDataSource dataSource;
public TransformError errorList;
public bool HasErrors {
get { return errorList.HasErrors(); }
// turns a sequence of key to many values into a new sequence
// where each value of a key from the first sequence becomes
// the a key in the second sequence and where its only value
// is its key from the first sequence. Example:
//
// [1, [one, un, einz]]
// [3, [two, deux, zwei]]
// [2, [three, trois, drei]]
//
// becomes:
@atifaziz
atifaziz / dynamic.cs
Created June 18, 2009 18:56
Expando stuff
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Dynamic;
using System.Collections;
using System.Runtime.CompilerServices;
using System.IO;
static class Program
using System;
using System.Collections.Specialized;
using System.Xml;
using Elmah.Assertions;
static class Program
{
static void Main()
{
var config = new XmlDocument();
<errorFilter>
<test>
<!-- http://groups.google.com/group/elmah/t/cbe82cee76cc6321 -->
<and>
<is-type binding='Exception'
type='System.Web.HttpException, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' />
<regex binding='Exception.Message'
pattern='invalid\s+viewstate'
caseSensitive='false' />
<regex binding='Context.Request.UserAgent'
// http://twitter.com/raboof/statuses/4974353119
static partial class TryParse
{
public static int? Int32(string str)
{
return Int32(str, null);
}
public static int? Int32(string str, int? defaultValue)
@atifaziz
atifaziz / rilie.py
Created January 12, 2010 23:21
IronPython client to save IE sessions to RIL
# Read It Later IE
# Utility to post IE sessions to http://readitlaterlist.com
#
# The MIT License
#
# Copyright (c) 2010, Atif Aziz
#
# Author(s):
#
# Atif Aziz, http://www.raboof.com/
@atifaziz
atifaziz / ToDataTable.cs
Created January 15, 2010 00:39
ToDataTable.cs
// Copyright (c) 2010, Atif Aziz. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
@atifaziz
atifaziz / rempath.py
Last active September 4, 2015 07:15
rempath.py
# rempath - Resolves UNC paths for paths over network mapped drives
# Copyright (c) 2010 Atif Aziz. All rights reserved.
#
# Author(s):
#
# Atif Aziz, http://www.raboof.com
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met: