Skip to content

Instantly share code, notes, and snippets.

@zippy1981
zippy1981 / ExamplePicture.class.php
Created April 14, 2012 22:33
Some example code for re-sizing images in PHP.
<?php
/**
* This file contains the class ExamplePicture.
* @package ExampleMiddleWare
**/
/**
* Include files
**/
require_once("bmp.php");
@zippy1981
zippy1981 / Program.cs
Created August 18, 2012 19:21
SharpSvn SvnLogEventArgs.LogOrigin demo
using System;
using System.Collections.ObjectModel;
using SharpSvn;
namespace Test.SharpSvn.LogOrigin
{
class Program
{
static void Main()
--- C:/Users/jdearing/Documents/deleteme/Sokol/Sheet1.xml.orig Tue Oct 02 13:56:26 2012
+++ C:/Users/jdearing/Documents/deleteme/Sokol/Sheet1.xml.new Tue Oct 02 13:56:32 2012
@@ -3,7 +3,7 @@
<dimension ref="A1:F13"/>
<sheetViews>
<sheetView tabSelected="1" workbookViewId="0">
- <selection activeCell="I7" sqref="I7"/>
+ <selection activeCell="C3" sqref="C3"/>
</sheetView>
</sheetViews>
@zippy1981
zippy1981 / Dynamic drop database.cs
Created October 12, 2012 11:55
Code Review request for dynamic SQL that drops a database
/// <summary>
/// Drop the db if it exists.
/// </summary>
private static void DropDbIfExists(SqlConnection cn, string dbName)
{
using (var cmd = cn.CreateCommand())
{
cn.Open();
cmd.CommandText =
@"IF EXISTS(SELECT name FROM sys.databases WHERE name = @dbName)
@zippy1981
zippy1981 / SqlRaisError.cs
Created October 15, 2012 12:27
C# RAISERROR Wrapper.
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Data.SqlTypes;
using System.Text;
public partial class SqlRaisError
{
/// <summary>
@zippy1981
zippy1981 / ConEmuTasks.reg
Created November 3, 2012 00:34
ConEmu Tasks Registry File
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\ConEmu\.Vanilla\Tasks]
"Count"=dword:00000009
[HKEY_CURRENT_USER\Software\ConEmu\.Vanilla\Tasks\Task1]
"Name"="{PowerShell}"
"GuiArgs"="/single /Dir %userprofile%"
"Cmd1"="%SystemRoot%\\system32\\WindowsPowerShell\\v1.0\\powershell.exe"
"Active"=dword:00000000

VPN ENabled: 1 1 ms 1 ms 1 ms Wireless_Broadband_Router.home [192.168.1.1] 2 4 ms 4 ms 4 ms lo0-100.NWRKNJ-VFTTP-329.verizon-gni.net [100.8.64.1] 3 9 ms 7 ms 5 ms T1-5-0-4.NWRKNJ-LCR-22.verizon-gni.net [100.41.210.48] 4 * * * Request timed out. 5 8 ms 8 ms 6 ms 0.ae4.GW10.EWR6.ALTER.NET [140.222.230.157] 6 6 ms 8 ms 7 ms teliasonera-gw.customer.alter.net [157.130.91.86] 7 7 ms 7 ms 6 ms cloudflare-ic-301663-nyk-b2.c.telia.net [213.248.77.162] 8 7 ms 7 ms 8 ms 198.41.208.140

@zippy1981
zippy1981 / 7zip.targets
Created January 5, 2013 22:03
Here is some working code to make a 7zip of a bin folder
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<TargetSevenZip>$(TargetDir)\$(TargetName).7z</TargetSevenZip>
<!-- See http://msdn.microsoft.com/en-us/magazine/dd419659.aspx#id0090093 -->
<CleanDependsOn>
CleanArt;
CleanSevenZip
$(CleanDependsOn);
</CleanDependsOn>
$assemblyPath = 'C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\ReferenceAssemblies\v2.0\Microsoft.TeamFoundation.VersionControl.Common.dll'
$types = Add-Type -Path $assemblyPath -PassThru
$enums = $types | where { $_.BaseType -eq [System.Enum] }
#<#
$enums | %{
$curEnum = $_
[enum]::getvalues([type]$curEnum) | % {
#$curEnum::Format($curEnum, $_, 'x')