Skip to content

Instantly share code, notes, and snippets.

View ianbattersby's full-sized avatar
🐘
@ianbattersby@hachyderm.io

Ian Battersby ianbattersby

🐘
@ianbattersby@hachyderm.io
View GitHub Profile
@ianbattersby
ianbattersby / gist:3260447
Created August 4, 2012 22:58
Mono 2.11 bash redirection for FSI (fsharpi)
#!/bin/sh
EXEC="exec "
if test x$1 = x--debug; then
DEBUG=--debug
shift
fi
if test x$1 = x--gdb; then
shift
@ianbattersby
ianbattersby / gist:3351676
Created August 14, 2012 18:55
Example of StyleCop exclusion for @NathanGloyn
<Compile Include="LeaveMyStyleCopAlone.cs">
<SubType>Code</SubType>
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile>
@ianbattersby
ianbattersby / .htaccess
Created September 30, 2012 13:57
geek.ianbattersby.com 310 .htaccess redirect
RewriteEngine ON
RewriteRule ^(.*)$ http://blog.ianbattersby.com/$1 [R=301,L]
// In an old skool way we might have considered simple polymorphic inheritance to
// demonstrate OCP, like so..
using System.Collections.Generic;
using System.Linq;
namespace SOLID_is_a_guideline.OCP.IansSimpleWithVersion
{
public inteface IBasket
{
$vmm = Get-SCVMMServer -ComputerName "my-vmm-host"
$ls = Get-SCLibraryServer -ComputerName "my-vmm-host"
Import-SCVirtualMachine -ImportVMPath "c:\temp\myovf.ovf" -LibraryServerObject $ls -VMMServerObject $vmm -LibrarySharePath "\\my-vmm-host\MSSCVMMLibrary\Import\" -VHDSourcePath "C:\Virtual Machines\BlankVHD.vhd" -VMName "MY-VM"
Import-SCVirtualMachine : Method not found: 'Int32 Microsoft.VirtualManager.Utils.MonitorResolutionLimits.GetMonitorResolutionIndex(Int32, System.String)'.
At line:1 char:1
+ Import-SCVirtualMachine -ImportVMPath
"C:\Temp\GitHubEnterprise\ReExport\github- ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@ianbattersby
ianbattersby / gist:4641450
Created January 26, 2013 09:46
Ubuntu TeamCity agent setup
#!/bin/bash
# THESE ARE NOTES, NOT TESTED AS SCRIPT!
# We need the following to get and run teamcity agent
sudo apt-get install openjdk-7-jre-headless
sudo apt-get install unzip #For unzipping buildAgent.zip
# For compiling Simple.Web
sudo apt-get install ruby1.9.1
Simple.Web.Razor.RazorCompilerException
c:\Users\ian\AppData\Local\Temp\bfesxmbj.0.cs(38,7) : error CS1026: ) expected
c:\Users\ian\AppData\Local\Temp\bfesxmbj.0.cs(38,7) : error CS1525: Invalid expression term ','
c:\Users\ian\AppData\Local\Temp\bfesxmbj.0.cs(38,12) : error CS1002: ; expected
c:\Users\ian\AppData\Local\Temp\bfesxmbj.0.cs(38,12) : error CS1525: Invalid expression term '=>'
c:\Users\ian\AppData\Local\Temp\bfesxmbj.0.cs(38,15) : error CS1002: ; expected
c:\Users\ian\AppData\Local\Temp\bfesxmbj.0.cs(42,2) : error CS1525: Invalid expression term ')'
c:\Users\ian\AppData\Local\Temp\bfesxmbj.0.cs(46,7) : error CS1026: ) expected
c:\Users\ian\AppData\Local\Temp\bfesxmbj.0.cs(46,7) : error CS1525: Invalid expression term ','
c:\Users\ian\AppData\Local\Temp\bfesxmbj.0.cs(46,12) : error CS1002: ; expected
@ianbattersby
ianbattersby / gist:4698950
Last active December 12, 2015 02:28
Dumping CodeDomUnit
var writer = new StreamWriter(File.Create("c:\\temp\\debug3.txt"));
codeProvider.GenerateCodeFromCompileUnit(razorResult.GeneratedCode, writer, new System.CodeDom.Compiler.CodeGeneratorOptions());
writer.Flush();
writer.WriteLine();
writer.Close();
[2013-02-05 13:33:15,584] WARN [on=editVcsRoot ] - jetbrains.buildServer.VCS - Error occurred in test connection
jetbrains.buildServer.vcs.VcsException: List remote refs failed: java.net.ConnectException: Connection time out: github.com
at jetbrains.buildServer.buildTriggers.vcs.git.OperationContext.wrapException(OperationContext.java:134)
at jetbrains.buildServer.buildTriggers.vcs.git.GitVcsSupport.getRemoteRefs(GitVcsSupport.java:497)
at jetbrains.buildServer.buildTriggers.vcs.git.GitVcsSupport.getCurrentState(GitVcsSupport.java:128)
at jetbrains.buildServer.buildTriggers.vcs.git.TestConnectionCommand.checkFetchConnection(TestConnectionCommand.java:100)
at jetbrains.buildServer.buildTriggers.vcs.git.TestConnectionCommand.testConnection(TestConnectionCommand.java:68)
at jetbrains.buildServer.buildTriggers.vcs.git.GitVcsSupport.testConnection(GitVcsSupport.java:412)
at jetbrains.buildServer.controllers.admin.projects.EditVcsRootsController.doPost(EditVcsRootsController.java:171)
at jetbrains.b
@ianbattersby
ianbattersby / gist:5128432
Last active December 14, 2015 18:19
Thinking about Kotlin web-framework..
annotation class UriTemplate(uri : String)
open class Get(properties : TGet) {
{
println(properties.javaClass.getAnnotation(javaClass<UriTemplate>()))
}
}
open class Post() {
}