Skip to content

Instantly share code, notes, and snippets.

View ScottWeinstein's full-sized avatar

scottw ScottWeinstein

  • NY
  • 19:26 (UTC -05:00)
View GitHub Profile
@ScottWeinstein
ScottWeinstein / markdownTodoList.css
Created August 21, 2013 02:07
CSS for todo lists via Markdown
html {
font-size: 100%;
overflow-y: scroll;
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
}
body{
font-family: helvetica, arial, freesans, clean, sans-serif;
color: #333;
@ScottWeinstein
ScottWeinstein / gist:2015047
Created March 11, 2012 04:35 — forked from bradwilson/InlineTask.targets.xml
Inline MSBuild task to download NuGet.exe
<UsingTask TaskName="DownloadNuGet" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll">
<ParameterGroup>
<OutputFilename ParameterType="System.String" Required="true" />
</ParameterGroup>
<Task>
<Reference Include="System.Core" />
<Reference Include="System.Xml" />
<Reference Include="WindowsBase" />
<Using Namespace="System" />
<Using Namespace="System.IO" />
@ScottWeinstein
ScottWeinstein / ex.md
Created January 19, 2012 23:20
MDExample

var hiding

public coid setTotal(BigDecimal total) {
    this.total = atotal;
}
@ScottWeinstein
ScottWeinstein / IsAlives.cs
Created May 28, 2011 16:26
Rx IsAlive UnitTests
// doesn't detect Never()
public static IObservable<bool> IsAlive_Merge<T>(this IObservable<T> source, TimeSpan timeout, IScheduler sched)
{
return source.Select(_ => true)
.Merge(source.Select(_ => false).Throttle(timeout, sched))
.DistinctUntilChanged();
}
// Delay detection of Alive till timespan has expired
public static IObservable<bool> IsAlive_Buffer<T>(this IObservable<T> source, TimeSpan timeout, IScheduler sched)
@ScottWeinstein
ScottWeinstein / .gitignore
Last active September 25, 2015 22:47
My Powershell profile
locals.ps1
vs2010.ps1
@ScottWeinstein
ScottWeinstein / SampleJsonToDynamicToEF.cs
Created March 30, 2011 02:54
sample code showing how to use the Dynamic version of System.Web.Helpers.Json.Decode to not write serialization mappers
/*
*string items might look like so
{'IVSet':[{'InterviewerId':'dd','InterviewType':'dd','ScheduledDate':'dd'}],
'FullName':'fsd','EmailAddress':'sdf','Phone':'sdf','notes_md':''}
*/
[HttpPost]
public ActionResult Edit(int id, string items)
{
Candidates candidate = _db.Candidates.Where(cd => cd.CandidateId == id).Single();
var decoded = System.Web.Helpers.Json.Decode(items);
@ScottWeinstein
ScottWeinstein / CoffeeScriptHandler.cs
Created March 27, 2011 03:41
CoffeeScriptHandler for ASP.Net
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using System.Diagnostics;
using System.Web.Caching;
using System.IO;
namespace CoffeeScriptHandler
@ScottWeinstein
ScottWeinstein / FakeHttpContext.cs
Created March 22, 2011 17:36
HttpContextBase for ASP.Net MVC
public static HttpContextBase FakeHttpContext()
{
var context = new Mock<HttpContextBase>();
var request = new Mock<HttpRequestBase>();
var response = new Mock<HttpResponseBase>();
var session = new Mock<HttpSessionStateBase>();
var server = new Mock<HttpServerUtilityBase>();
var user = new Mock<IPrincipal>();
var identity = new Mock<IIdentity>();