This file contains 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 pdfSplitIntoPages() | |
{ | |
// EO.Pdf.Runtime.AddLicense("..."); | |
string sourceFile = @"C:\TEMP\Blah.pdf"; | |
var pdf = new PdfDocument(sourceFile); | |
var pages = pdf.Split(Enumerable.Range(1, pdf.Pages.Count-1).ToArray()); | |
var i = 1; | |
foreach (PdfDocument page in pages) | |
{ |
This file contains 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.Speech.Synthesis; // Add System.Speech from Add Reference | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
Console.Write("Enter your name: "); | |
var name = Console.ReadLine(); | |
This file contains 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.Routing; | |
public static class RouteUtils | |
{ | |
/// <summary> | |
/// e.g. <code>var routeData = RouteTable.Routes.GetRouteDataForPath("~/foo/bar");</code> |
This file contains 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.IO; | |
using System.Linq; | |
using System.Text.RegularExpressions; | |
namespace ZipReducedOneFile | |
{ | |
class Program | |
{ | |
static void Main() |
This file contains 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.Linq.Expressions; | |
using System.Collections.Concurrent; | |
using System.Reflection; | |
static class ReflectionUtil | |
{ | |
static ConcurrentDictionary<PropertyInfo, Func<object, object>> _propertyGettersCache = new ConcurrentDictionary<PropertyInfo, Func<object, object>>(); |
This file contains 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 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 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 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 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); |
OlderNewer