Skip to content

Instantly share code, notes, and snippets.

View andyedinborough's full-sized avatar

Andy Edinborough andyedinborough

View GitHub Profile
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Remoting_Test {
class Program {
static void Main(string[] args) {
AE.Remoting.Settings.Current.RemotingHost = "localhost";
@andyedinborough
andyedinborough / Memberwise-Clone-Example.cs
Created April 26, 2010 14:13
Let you do a memberwise clone on a object of a base-type to an object of it's parent-type
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
namespace ConsoleApplication1 {
public class a {
public string testa { get; set; }
public virtual string Who() {
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
namespace ConsoleApplication1 {
public class Student {
public string Name { get; set; }
}

in your html

site.less .opacity { opacity: 0.5 }

 .corners {

border-radius: 3px;

//lifted from http://imgscalr.com/public/scripts/main.js
(function (window, document, $, tracky) {
var isEventSupported = (function () {
var TAGNAMES = {
'select': 'input',
'change': 'input',
'submit': 'form',
'reset': 'form',
'error': 'img',
'load': 'img',
@andyedinborough
andyedinborough / jquery.oauth.js
Created June 7, 2011 19:30
Introduces $.oauth() to make using OAuth from jQuery as easy as using $.ajax()
(function (window, document, $, undefined) {
if (!$.Deferred) throw 'jQuery 1.5 is required to use the jQuery.oauth script!';
function require(name, url) {
if (window[name] === undefined)
return $.ajax({ type: 'GET', cache: true, dataType: 'script', url: url });
}
$.oauth = function (options) {
var d = $.Deferred();
@andyedinborough
andyedinborough / RazorCompiler.cs
Created June 9, 2011 14:04
Update for Mvc Mini Profiler's RazorCompiler.cs
using System;
using System.CodeDom;
using System.CodeDom.Compiler;
using System.Collections.Concurrent;
using System.IO;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Web;
using System.Web.Razor;
public class MvcApplication : System.Web.HttpApplication {
void Application_Start() {
MvcMiniProfiler.Data.ProfiledDbProviderFactory.RegisterProviders();
}
}
@andyedinborough
andyedinborough / jquery.oauth.js
Created October 12, 2011 13:10
Adds an $.oauth() function to jQuery which mimics the $.ajax() function
/*
MIT License (MIT)
Copyright (c) 2011 Andy Edinborough
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH TH
using System;
using System.IO;
namespace AE.Net.Mail {
//http://stackoverflow.com/questions/842465/reading-a-line-from-a-streamreader-without-consuming
public class PeekableTextReader : TextReader {
private TextReader _Underlying;
private MemoryStream _Buffer;
private StreamReader _BufferReader;
private StreamWriter _BufferWriter;