Skip to content

Instantly share code, notes, and snippets.

@davidalpert
davidalpert / dep.cs
Created July 4, 2011 21:57 — forked from gregoryyoung/dep.cs
depositor specification
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using Simple.Testing.Framework;
namespace Simple.Testing.Example
{
/*
@davidalpert
davidalpert / gist:1079716
Created July 13, 2011 04:24
a sample NancyModule demonstrating a base modulePath
public class MainModule : NancyModule
{
public MainModule() : base("/blog")
{
Get["/posts"] = parameters => {...};
Get["/tags"] = parameters => {...};
Get["/categories"] = parameters => {...};
}
}
@davidalpert
davidalpert / gist:1079718
Created July 13, 2011 04:26 — forked from thecodejunkie/gist:898770
Blog - Hello World
public class MainModule : NancyModule
{
public MainModule()
{
Get["/"] = parameters => {
return "Hello World";
};
}
}
namespace Nancy.Demo.Hosting.Self
{
using System;
using System.Diagnostics;
using Nancy.Hosting.Self;
class Program
{
static void Main()
namespace Nancy.Demo.Hosting.Self
{
using System;
using System.Diagnostics;
using Nancy.Hosting.Self;
class Program
{
static void Main()
@davidalpert
davidalpert / RecursiveReplace.ps
Created December 29, 2011 13:50 — forked from jongalloway/RecursiveReplace.ps
Recursive replace in files (PowerShell)
$find = 'jquery-1\.4\.4'
$replace = 'jquery-1\.5\.1'
$match = '*.cshtml' , '*.vbhtml'
$preview = $true
foreach ($sc in dir -recurse -include $match | where { test-path $_.fullname -pathtype leaf} ) {
select-string -path $sc -pattern $find
if (!$preview) {
(get-content $sc) | foreach-object { $_ -replace $find, $replace } | set-content $sc
}
@davidalpert
davidalpert / gist:2022220
Created March 12, 2012 14:19 — 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" />
@davidalpert
davidalpert / gist:3710336
Created September 12, 2012 22:13
nuget.copy.extension error
>> e:\Users\davida\dev\main.git-tfs>.nuget\NuGet.exe copy Common.Logging -version 2.1.1.0 -destination \\local_share\NugetServer\Packages
Method not found: 'System.Collections.Generic.List`1<System.String> NuGet.Commands.Command.get_Arguments()'.
@davidalpert
davidalpert / gist:3730925
Created September 16, 2012 03:38
Use powershell and the nuget.copy.extension to copy all packages from a config file to a local file share.
E:\Dev\YourSolutionFolder> foreach ($package in ([xml](Get-Content .\YourProject\packages.config))).packages.package) { nuget copy $package.id -version $package.version -dest c:\localshare\ }
task Describe-Properties -Description "Prints out script property values." {
$psake.context.peek().properties
}