Skip to content

Instantly share code, notes, and snippets.

using System;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using System.IO;
using System.Linq;
using System.Net.Configuration;
using System.Net.Mail;
using System.Text;
using System.Web;
using System;
using System.Collections.Generic;
using System.Dynamic;
public class TurboObject : DynamicObject
{
private readonly object _defaultValue;
private readonly Dictionary<string, object> _vals = new Dictionary<string, object>();
public TurboObject()
namespace RockPaperAzure
{
using System;
using System.Collections.Generic;
using System.Linq;
using RockPaperScissorsPro;
public class MyBot : IRockPaperScissorsBot
{
private readonly List<Move> _opponentMoves;
using System;
using System.Security.Cryptography;
using System.Text;
public static class Crypto
{
#region MD5
public static string HashMD5(string phrase)
{
@rushfrisby
rushfrisby / REST API Contract Spec.js
Last active August 29, 2015 14:02
REST API Contract Spec
{
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: [{
<#@ 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" #>
@rushfrisby
rushfrisby / FilterCriteria.cs
Created July 2, 2014 17:04
FilterCriteria used for paging
public class FilterCriteria
{
public int Skip { get; set; }
public int Take { get; set; }
}
@rushfrisby
rushfrisby / PagedResultSet.cs
Created July 2, 2014 17:06
PagedResultSet used for paging
public class PagedResultSet<T>
{
private int _endRecord;
private int _startRecord;
public PagedResultSet()
{
PageResults = new List<T>();
TotalRecords = 0;
StartRecord = 0;
@rushfrisby
rushfrisby / JsonSchemaToPocos.cs
Last active June 2, 2023 07:45
Converts a JSON schema to C# POCO classes
class Program
{
private const string Cyrillic = "Cyrillic";
private const string Nullable = "?";
static void Main()
{
string schemaText;
using (var r = new StreamReader("schema.txt"))
@rushfrisby
rushfrisby / arraytests.js
Created August 2, 2014 06:49
JavaScript Array Tests
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);
}