Skip to content

Instantly share code, notes, and snippets.

class Hash
def prepend(value, key)
aditional_value = delete(key)
merge! key => "#{value} #{aditional_value}".rstrip
end
end
@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
@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
@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
}
<#@ 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;
@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" />
@davidfowl
davidfowl / dotnetlayout.md
Last active July 22, 2024 09:49
.NET project structure
$/
  artifacts/
  build/
  docs/
  lib/
  packages/
  samples/
  src/
 tests/