This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[STAThread] | |
static int Main(string[] args) | |
{ | |
//load assembly via the resources (such as using Costura advanced): | |
AttachResolverForLocalPaths(); | |
} | |
public static void AttachResolverForLocalPaths() | |
{ | |
var currentDomain = AppDomain.CurrentDomain; | |
currentDomain.AssemblyResolve += OnCurrentDomainOnAssemblyResolve; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
^[^\S\r\n]*[^using](?<sql>new SQLiteCommand\((.*), (.*)\))\.ExecuteNonQuery\(\); | |
replace with: | |
using (var c = ${sql})\nc.ExecuteNonQuery(); | |
Finding any SQLiteCommand that is wrapped in a using statement: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Web; | |
using System.Web.Mvc; | |
namespace System.Web.Mvc.Html | |
{ | |
public static class TwitterBootstrapHelperExtensions |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
echo =========================================================================== | |
echo This batch file will upload tomato.trx in the current directory to | |
echo 192.168.11.1 during the router's bootup. | |
echo. | |
echo * Set your ethernet card's settings to: | |
echo IP: 192.168.1.2 | |
echo Mask: 255.255.255.0 | |
echo Gateway: 192.168.1.1. | |
echo * Unplug the router's power cable. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# SetAssemblyVersion.ps1 | |
# | |
# http://www.luisrocha.net/2009/11/setting-assembly-version-with-windows.html | |
# http://blogs.msdn.com/b/dotnetinterop/archive/2008/04/21/powershell-script-to-batch-update-assemblyinfo-cs-with-new-version.aspx | |
# http://jake.murzy.com/post/3099699807/how-to-update-assembly-version-numbers-with-teamcity | |
# https://github.com/ferventcoder/this.Log/blob/master/build.ps1#L6-L19 | |
Param( | |
[string]$path=$pwd | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
task default -depends GetBuildNumber | |
task GetBuildNumber { | |
Assert ($base_directory -ne $null) '$base_directory should not be null. Try %system.teamcity.build.checkoutDir%' | |
Assert ($solution_name -ne $null) '$solution_name should not be null' | |
$version = gc $base_directory\$solution_name\Properties\AssemblyInfo.cs | select-string -pattern "AssemblyVersion" | Out-String | |
$version | Foreach-Object { Write-Host $_ } | |
$version -imatch '\[assembly: Assembly(File)?Version\("(?<major>[0-9]+)\.(?<minor>[0-9]+)\.(?<revision>[0-9]+)\.(?<build>[0-9]+)"\)\]' | Out-Null | |
Assert ($matches -ne $null) 'Unable to find AssemblyVersion string!' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Global : HttpApplication | |
{ | |
public void Application_Start() | |
{ | |
// Clears all previously registered view engines. | |
ViewEngines.Engines.Clear(); | |
// Registers our Razor C# specific view engine. | |
// This can also be registered using dependency injection through the new IDependencyResolver interface. | |
ViewEngines.Engines.Add(new RazorViewEngine()); |
NewerOlder