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
:: Runs IIS Express and exits. IIS Express is kept alive by WScript.exe | |
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: | |
:: NOTE, these are ignored if a file called IISExpress.config exists | |
set SITE_PORT=8080 | |
set SITE_PATH=%~dp0 | |
set SITE_CLR=v4.0 | |
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: | |
set IISEXPRESS=%ProgramFiles%\IIS Express\iisexpress.exe |
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
// Runs IIS Express without a console window (if started with wscript.exe) | |
var sitePort = 8080; | |
var sitePath = "."; | |
var siteClr = "v4.0"; | |
var fso = new ActiveXObject("Scripting.FileSystemObject"); | |
var wshell = new ActiveXObject("WScript.Shell"); | |
// Resolve path |
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.Globalization; | |
using System.Threading; | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
string[] words = "chat city cabs".Split(' '); |
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.Reflection; | |
using System.Linq.Expressions; | |
class ExpressionUtil | |
{ | |
// Returns the MethodInfo of the given lambda. Use instead of Type.GetMethod("name", paramTypes). | |
public static MethodInfo GetMethod<T>(Expression<Action<T>> lambda) | |
{ | |
var call = lambda.Body as MethodCallExpression; |
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 | |
:: Required Config | |
set SVN_SOURCE=http://svnserver/svn/myrepo/mysolution | |
set WEB_PROJ_SUBDIR=Web | |
set PACKAGE_OUTPUT=C:\Builds\Packages | |
:: Required binaries | |
set SVN="%ProgramFiles(x86)%\CollabNet Subversion Client\svn.exe" | |
set MSBUILD="%SystemRoot%\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe" |
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.Linq; | |
using System.Linq.Expressions; | |
using System.Diagnostics; | |
// Our model classes | |
class Person | |
{ | |
public int Id { get; set; } | |
public FullName FullName { get; set; } |
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
static void DumpCommand(SqlCommand command) | |
{ | |
foreach (SqlParameter p in command.Parameters) | |
{ | |
Debug.Write("DECLARE " + p.ParameterName + " " + p.SqlDbType.ToString().ToLower()); | |
if (p.Size > 0) | |
Debug.Write("(" + p.Size + ")"); | |
Debug.Write(" = "); | |
if (p.Value is Enum) | |
Debug.Write((int)p.Value); |
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
internal static class DataReaderUtil | |
{ | |
public static T GetValue<T>(this IDataRecord record, string columnName) | |
{ | |
T result = default(T); | |
int ordinal = record.GetOrdinal(columnName); | |
if (record.IsDBNull(ordinal)) | |
return result; |
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
$http = new-object System.Net.WebClient | |
$feed = [xml]$http.DownloadString("https://nuget.org/api/v2/Packages") | |
$feed.feed.entry | % { | |
$http.DownloadFile($_.content.src, ("C:\temp\"+ $_.title.InnerText + "." + $_.Properties.Version +".nupkg")) | |
} |
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
SET NOCOUNT ON | |
DECLARE @bakfile nvarchar(max) = 'C:\Temp\MyDb.BAK'; | |
DECLARE @dbname nvarchar(max) = 'MyDb'; | |
--DECLARE @datapath nvarchar(max) = 'c:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA'; | |
DECLARE @datapath nvarchar(max) = (SELECT TOP(1) left(physical_name, len(physical_name) - len('\master.mdf')) FROM master.sys.database_files) | |
--SELECT @datapath | |
--Drop db if exists |
OlderNewer