Skip to content

Instantly share code, notes, and snippets.

@zippy1981
zippy1981 / gist:841433
Created February 23, 2011 23:35
Using powershell to list particular files in svn.
Add-Type -AssemblyName "System.Web"
# Powershell function to iterate through all the branches of a
# Visual Studio Solution in SVN, and return the file names in particular subfolders of the database project
# Assumes the command line svn client is in the system path
function Get-ReleaseScripts (
[string] $branchRoot,
[string] $subProject,
[string[]] $scriptFolders = ('Ad Hoc Scripts', 'Release Scripts')
) {
@zippy1981
zippy1981 / States.Table.sql
Created February 17, 2011 18:38
Creates a table that lists state names and abbreviations.
-- Created a simple table for storing state names and postal abbreviations.
SET NOCOUNT ON;
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[States]') AND type in (N'U'))
DROP TABLE [dbo].[States]
GO
CREATE TABLE States (
Name varchar(30) NOT NULL, --The largest "state" name is 'FEDERATED STATES OF MICRONESIA' which is exactly 30 characters long
@zippy1981
zippy1981 / LoginToSysadmin.sql
Created February 8, 2011 22:06
Script to make a windows user a sql server sysadmin
--- First we create a login from our user
CREATE LOGIN [domain\justin.dearing] FROM WINDOWS;
GO
-- Now we make him sysadmin
EXEC sp_addsrvrolemember
@rolename='sysadmin',
@loginame='domain\justin.dearing'
GO
@zippy1981
zippy1981 / Objectid.js
Created January 14, 2011 21:09
Javascript object class for dealing with ObjectIds as JSON serialized by WCF
/*
*
* Copyright (c) 2011 Justin Dearing (zippy1981@gmail.com)
* Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
* and GPL (http://www.opensource.org/licenses/gpl-license.php) version 2 licenses.
* This software is not distributed under version 3 or later of the GPL.
*
* Version 1.0.0-RC1
*
*/
--
-- Ad Hoc IIS Log analysis
-- Based on code from http://support.microsoft.com/kb/296085
-- Updated to work with the IIS log column config from my
-- particular inherited Windows 2008 server.
--
DROP TABLE #IISLogs
GO