Format:
Recent snippets for: Jon Sagara
$dbDir = "C:\Dev\MyProject\branches\1.0.0\src\Database\" $viewsDir = [IO.Path]::Combine($dbDir, "Views") $functionsDir = [IO.Path]::Combine($dbDir, "Functions") $sprocsDir = [IO.Path]::Combine($dbDir, "Stored Procedures") $dbServer = "(local)\SQL2k8" #Write-Host $dbDir #Write-Host $viewsDir
147 Views
no comments
# ------------------------------------------------------------------------------------------------- # Pinger.ps1 # # 2011-05-25: moved to gist.github.com # https://gist.github.com/992625 # -------------------------------------------------------------------------------------------------
697 Views
no comments
# ------------------------------------------------------------------------------------------------- # InstallUtilPs.ps1 # # Wrapper around InstallUtil.exe. # ------------------------------------------------------------------------------------------------- # Script params param([switch]$u) # uninstall $dotNetRuntimeDir = [System.Runtime.InteropServices.RuntimeEnvironment]::GetRuntimeDirectory()
262 Views
no comments
public class SqlAppender : AppenderSkeleton { private static readonly string CommandText = "INSERT INTO Log ([Date],[Thread],[Level],[Logger],[Message],[Exception]) VALUES (@log_date, @thread, @log_level, @logger, @message, @exception)"; public string ConnectionString { get; set; } protected override void Append(LoggingEvent loggingEvent) { using (var conn = new SqlConnection(ConnectionString)) using (var cmd = new SqlCommand(CommandText, conn))
270 Views
no comments
public static void ResizeImage() { using (Bitmap src = new Bitmap(_ImgOriginal)) { int destWidth = (int)(0.5 * src.Width); int destHeight = (int)(0.5 * src.Height); using (Bitmap dest = new Bitmap(destWidth, destHeight)) using (Graphics gDest = Graphics.FromImage(dest)) {
325 Views
no comments
// 2010-10-12: Code has moved to http://bitbucket.org/jonsagara/extensionmethods/
268 Views
no comments
// Update 2010-10-12: This code has been moved to BitBucket:
// http://bitbucket.org/jonsagara/weightedrandom/
575 Views
no comments
using System; using System.Runtime.InteropServices; /// <summary> /// Class that encapsulates the Win32 function CLSIDFromString. Idea taken from /// http://stackoverflow.com/questions/104850/c-test-if-string-is-a-guid-without-throwing-exceptions/287877#287877 /// </summary> public static class GuidHelper {
354 Views
no comments
Subscribe
Discuss
What's new
What is it
New Snippet
Recent Snippets
My Snippets
Web Code
Search
