This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Stopwatch() | |
{ | |
var sw = this; | |
var start = null; | |
var stop = null; | |
var isRunning = false; | |
sw.__defineGetter__("ElapsedMilliseconds", function() | |
{ | |
return (isRunning ? new Date() : stop) - start; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using AutoMapper; | |
using Microsoft.CodeAnalysis; | |
using Microsoft.CodeAnalysis.CSharp; | |
using System; | |
using System.IO; | |
using System.Text; | |
namespace PclBreakage | |
{ | |
class Program |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Diagnostics; | |
namespace JsEnginePerformanceComparison | |
{ | |
class Program | |
{ | |
static void Main() | |
{ | |
var done = false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var ret = [], tmp, num = 500, i = 1024; | |
for ( var j1 = 0; j1 < i * 15; j1++ ) { | |
ret = []; | |
ret.length = i; | |
} | |
for ( var j2 = 0; j2 < i * 10; j2++ ) { | |
ret = new Array(i); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Program | |
{ | |
private const string Cyrillic = "Cyrillic"; | |
private const string Nullable = "?"; | |
static void Main() | |
{ | |
string schemaText; | |
using (var r = new StreamReader("schema.txt")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class PagedResultSet<T> | |
{ | |
private int _endRecord; | |
private int _startRecord; | |
public PagedResultSet() | |
{ | |
PageResults = new List<T>(); | |
TotalRecords = 0; | |
StartRecord = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class FilterCriteria | |
{ | |
public int Skip { get; set; } | |
public int Take { get; set; } | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<#@ template language="C#" debug="true" hostspecific="True" #> | |
<#@ output extension=".cs"#> | |
<#@ assembly name="System.Core" #> | |
<#@ assembly name="System.Data" #> | |
<#@ import namespace="System" #> | |
<#@ import namespace="System.Data" #> | |
<#@ import namespace="System.Data.SqlClient" #> | |
<#@ import namespace="System.IO" #> | |
<#@ import namespace="System.Text" #> | |
<#@ import namespace="System.Text.RegularExpressions" #> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
BasePath: "http://www.domain.com/", //the url of your application's root | |
Version: 1.0, | |
Types: [{ //includes custom types and not built-in types like "string". Generics supported. | |
Name: "NameOfType", | |
Properties: [{ | |
"NameOfProperty": "TypeOfProperty" | |
}] | |
}], | |
Methods: [{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Security.Cryptography; | |
using System.Text; | |
public static class Crypto | |
{ | |
#region MD5 | |
public static string HashMD5(string phrase) | |
{ |