Skip to content

Instantly share code, notes, and snippets.

$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')
@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>
@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
@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 / 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)
--- 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 / 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()
@zippy1981
zippy1981 / SOS.ino
Created April 22, 2012 20:32
Arduino SOS Program
/*
SOS
Sends SOS in morse code on the Arduino board.
For more information see http://en.wikipedia.org/wiki/Morse_code
Copyright 2012 Justin Dearing.
*/
int dotDur = 125;
int dashDur = dotDur * 3;
@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");