Skip to content

Instantly share code, notes, and snippets.

@atifaziz
atifaziz / HtmlEncoder.cs
Created September 23, 2008 21:53
HTML encoder using named entities
#region Imports
using System;
using System.Globalization;
using System.Text;
using System.Text.RegularExpressions;
#endregion
public static class HtmlEncoder
namespace Ext.IO
{
#region Imports
using System;
using System.IO;
using System.Diagnostics;
#endregion
using System;
using System.Collections.Generic;
static class ArrayExtensions {
public static void StableSort<T>(this T[] values, Comparison<T> comparison) {
var pairs = new KeyValuePair<int, T>[values.Length];
for (var i = 0; i < values.Length; i++)
pairs[i] = new KeyValuePair<int, T>(i, values[i]);
Array.Sort(pairs, values, new StabilizingComparer<T>(comparison));
@atifaziz
atifaziz / MimeMap.cs
Created October 3, 2008 12:26
MIME Mapping (C#)
#region Imports
using System;
using System.Collections.Generic;
using System.Linq;
using System.Collections;
using System.Configuration;
using System.IO;
#endregion
Array.range = function(start, end)
{
if (!end)
{
end = start;
start = 0;
}
var a = [];
for (var i = start; i < end; i++)
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Threading;
internal static class Program
{
private static void Main(string[] args)
{
@atifaziz
atifaziz / lsz.cmd
Created October 27, 2008 13:37
UTC patch batch for msls
@echo off
setlocal
set TZ=UTC0
rem GNU ls for Microsoft Windows:
rem http://utools.com/msls.asp
rem Tip: --time-style="+%Y-%m-%d %H:%M:%S %z"
ls %*
@atifaziz
atifaziz / NameObjectCollectionBase.cs
Created October 29, 2008 09:16
A modern implementation of NameValueCollection
#region Imports
using System;
using System.Diagnostics;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
#endregion
@atifaziz
atifaziz / rdel.js
Created October 29, 2008 15:17
Recyclable Delete Utility (RDEL)
//
// Recyclable Delete Utility (RDEL)
// Written by Atif Aziz
// http://www.raboof.com/
//
// Copyright (c) 2004-8 Atif Aziz. All rights reserved.
//
// DISCLAIMER: The software and source code is provided "AS IS" with no
// warranties of any kind. The entire risk arising out of the use or
// performance of the software and source code is yours.
@ECHO OFF
:: Set all parameters. Even though most are not used, in case you want to add
:: changes that allow, for example, editing of the author or addition of log messages.
set repository=%1
set revision=%2
set userName=%3
set propertyName=%4
set action=%5
:: Only allow the log message to be changed, but not author, etc.