Skip to content

Instantly share code, notes, and snippets.

@davidfowl
davidfowl / dotnetlayout.md
Last active November 13, 2024 13:19
.NET project structure
$/
  artifacts/
  build/
  docs/
  lib/
  packages/
  samples/
  src/
 tests/
@bradwilson
bradwilson / InlineTask.targets.xml
Created March 11, 2012 00:41
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" />
<#@ template debug="false" hostspecific="true" language="C#" #>
<#@ import namespace="System.IO" #>
<#@ output extension=".cs" #>
using System;
using System.Windows;
<#
var pathEntries = System.Environment.GetEnvironmentVariable("PATH").Split(Path.PathSeparator);
FileInfo gitFileInfo = null;
@jongalloway
jongalloway / RecursiveReplace.ps
Created December 29, 2011 07:56
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
}
@gregoryyoung
gregoryyoung / Sample.cs
Created July 4, 2011 14:51
Sample Test From Simple.Testing
//This is a sample specification.
public SutSpecification<Depositor> when_withdrawing_money_from_empty_account = new SutSpecification<Depositor>
{
On = () => new Depositor(13),
When = depositor => depositor.Withdraw(50.00m),
Expect =
{
depositor => depositor.Balance > 0.01m,
depositor => depositor.AccountIsOpen
@prabirshrestha
prabirshrestha / hgrc
Created October 17, 2010 07:57
hgrc file for nupack
[paths]
default = https://hg01.codeplex.com/forks/prabirshrestha/cls
[extensions]
reviewboard = D:\Prabir\Documents\PortableApps\msys\msys\1.0\share\mercurial-reviewboard
[reviewboard]
server = http://reviewboard.nupack.com/
user = prabir
class Hash
def prepend(value, key)
aditional_value = delete(key)
merge! key => "#{value} #{aditional_value}".rstrip
end
end