Skip to content

Instantly share code, notes, and snippets.

@mhoyer
mhoyer / hg-prompt.zsh-theme
Created February 16, 2011 18:58
Cached hg prompt
HG_PROMPT="%{$fg[cyan]%}ʜɢ%{$reset_color%}>"
function prompt_char {
[ $HG_CURRENT_ROOT ] && echo $HG_PROMPT && return
#hg root >/dev/null 2>/dev/null && echo "$HG_PROMPT>" && return
#git branch >/dev/null 2>/dev/null && echo '±' && return
echo '>'
}
@mhoyer
mhoyer / cygwin-config.sh
Last active December 28, 2017 22:24
Cygwin base installation
# 1. Download cygwin setup-x86.exe from http://www.cygwin.com/setup-x86.exe.
# 2. Install with wget package.
# 3. Run cygwin.bat with Administrator rights
cd /tmp
# wget http://apt-cyg.googlecode.com/svn/trunk/apt-cyg
wget https://github.com/Milly/apt-cyg/raw/master/apt-cyg --no-check-certificate
chmod +x apt-cyg
mv apt-cyg /bin/apt-cyg
apt-cyg update
@mhoyer
mhoyer / sl2net.cmd
Created May 14, 2011 07:27
Silverlight to "classic" .NET assembly converter
SET ILDASM=C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin\ildasm.exe
SET ILASM=C:\Windows\Microsoft.NET\Framework\v4.0.30319\ilasm.exe
mkdir $(TargetDir).net
"%ILDASM%" "$(TargetPath)" /out:"$(TargetDir)$(TargetName).il"
sed -i "s/7C EC 85 D7 BE A7 79 8E/B7 7A 5C 56 19 34 E0 89/" "$(TargetDir)$(TargetName).il"
sed -i "s/ \.ver 2:0:5:0/ .ver 2:0:0:0/" "$(TargetDir)$(TargetName).il"
del "$(TargetDir)sed??????"
"%ILASM%" "$(TargetDir)$(TargetName).il" /dll /resource:"$(TargetDir)$(TargetName).res" /out:"$(TargetDir).net\$(TargetName).dll"
@mhoyer
mhoyer / git-svn-workflow.sh
Created May 19, 2011 13:12
git-svn workflow
# Initial checkout
mkdir foo-project
cd foo-project
git svn init http://<path-to-svn>/trunk .
git config --get-regexp 'svn-remote.*'
git svn fetch # fetch all revisions from remote svn to local git
git svn rebase
# some helping aliases
alias gdif='git diff'
@mhoyer
mhoyer / post-commit.sh
Created January 6, 2012 13:42
git-backup with auto generated backup remote
#!/bin/sh
GIT_MAIN_ROOT=/tmp/git-backup/git.repos
GIT_BACKUP_ROOT=/tmp/git-backup/git.repos.bak
GIT_BACKUP_REMOTE=backup
######
echo \>\>\> Backing up to $GIT_BACKUP_ROOT
@mhoyer
mhoyer / svn-git-convert.sh
Created January 27, 2012 00:17
Sample to check feasability of converting complex SVN repos to git repos
root=/tmp/svn-git-convert/
rm -fr $root
mkdir $root
svnadmin create $root/foo.svn
svn co file://$root/foo.svn $root/foo
pushd $root/foo
@mhoyer
mhoyer / missing-Castle.MicroKernel
Created February 9, 2012 13:02
No Castle.MicroKernel
c:\temp>nuget install castle.windsor -version 2.1.1
Attempting to resolve dependency 'Castle.Core (≥ 1.2.0)'.
Attempting to resolve dependency 'log4net (≥ 1.2.10)'.
Attempting to resolve dependency 'NLog (≥ 1.0.0.505)'.
Attempting to resolve dependency 'Castle.DynamicProxy (≥ 2.2.0)'.
Successfully installed 'log4net 1.2.11'.
Successfully installed 'NLog 1.0.0.505'.
Successfully installed 'Castle.Core 1.2.0'.
Successfully installed 'Castle.DynamicProxy 2.2.0'.
Successfully installed 'Castle.Windsor 2.1.1'.
@mhoyer
mhoyer / FilteredStatLightTest.cs
Last active September 30, 2015 14:08
Using TagAttribute with StatLight and its -t argument
[TestClass]
public class Salutes
{
[TestMethod]
public void ItShouldSayHello() { }
[TestMethod, Tag("Important")]
public void ItShouldSayGoodBye() { }
[TestMethod, Tag("Ignore")]
@mhoyer
mhoyer / mspec.delegates.cs
Created February 12, 2012 13:22
Live template for Machine.Specifications delegates
Establish context = () => $END$;
Because of = () => $END$;
It should_$do$ = () => $END$;
@mhoyer
mhoyer / NBuilder.nuspec
Created March 26, 2012 13:44
NBuilder nuspec for 3.0.1.2 due to missing SL binaries.
<?xml version="1.0"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>NBuilder</id>
<version>3.0.1.2</version>
<title>NBuilder</title>
<authors>Gareth Down</authors>
<owners>Gareth Down</owners>
<licenseUrl>http://www.gnu.org/licenses/lgpl.html</licenseUrl>
<projectUrl>http://nbuilder.org/</projectUrl>