Skip to content

Instantly share code, notes, and snippets.

View timvw's full-sized avatar

Tim Van Wassenhove timvw

View GitHub Profile
tims-mbp:~ timvw$ azure vm list
info: Executing command vm list
+ Getting virtual machines
info: No VMs found
info: vm list command OK
tims-mbp:~ timvw$ azure vm disk delete icteam-web-01-icteam-web-01-0-201401261917030704
info: Executing command vm disk delete
info: Deleting image
error: Disk not deleted: icteam-web-01-icteam-web-01-0-201401261917030704
@timvw
timvw / gist:11208834
Created April 23, 2014 09:39
Transfer repositories
# write all remote fetch locations into repositories.txt
find /c/src -type d -mindepth 1 -maxdepth 1 -exec git --work-tree={} --git-dir={}/.git remote -v \; | grep fetch | awk '{print $2}' > repositories.txt
# clone each repository
cat repositories.txt | xargs -l1 git clone
@timvw
timvw / gist:11372222
Last active August 29, 2015 14:00
Git fetch all repositories
find ~/src -type d -name .git -maxdepth 2 -execdir git fetch \;
open ServiceStack.ServiceInterface
open ServiceStack.WebHost.Endpoints
type Hello = { mutable Name: string; }
type HelloResponse = { mutable Result: string; }
type HelloService() =
inherit Service()
member this.Any (req:Hello) = { Result = "Hello, " + req.Name }
# Load unzip support
[Reflection.Assembly]::LoadWithPartialName("System.IO.Compression.FileSystem") | Out-Null
function Unzip($zipFile, $destination)
{
If (Test-Path $destination){
Remove-Item $destination -Recurse | Out-Null
}
New-Item -ItemType directory -Force -Path $destination | Out-Null
[System.IO.Compression.ZipFile]::ExtractToDirectory($zipFile, $destination) | Out-Null
@timvw
timvw / on_off_constraints
Created November 18, 2014 14:21
on_off constraints
SET SERVER OUTPUT ON;
WHENEVER SQLERROR EXIT;
DECLARE
v_sql VARCHAR2(32000);
CURSOR c_disableConstraints IS
SELECT 'alter table '||table_name||' disable constraint '||constraint_name sqlstatement
FROM USER_CONSTRAINTS
@timvw
timvw / import_template.sql
Last active August 29, 2015 14:09
PL/SQL template for doing a data import
SET SERVER OUTPUT ON;
WHENEVER SQLERROR EXIT;
DECLARE
v_sql VARCHAR2(32000);
CURSOR c_disableConstraints IS
SELECT 'alter table "'||table_name||'" disable constraint "'||constraint_name||'"' sqlstatement
FROM USER_CONSTRAINTS
@timvw
timvw / gist:12c0a7d67605c442e80c
Created January 5, 2015 10:28
Apply GIT patch on SVN
# make patch from last commit
git format-patch -1 --no-prefix
# apply patch on svn
path -p0 < blahblah.patch
@timvw
timvw / list-hintpaths.ps1
Created March 27, 2015 09:51
List all the hintpaths in csproj files under $BasePath (Launches excel with the results)
param(
[string] $BasePath = 'C:\src\trunk\',
[string] $OutFile = 'C:\temp\' + $BasePath.Replace("\","_").Replace(":","").Replace(" ","").ToLowerInvariant() + '_' +(get-date -uformat "%Y-%m-%D-%H-%M-%S") + '.csv'
)
function GetHintPaths {
param(
[string] $CsProjFile = 'C:\src\trunk\ICTEAM.Solution\ICTEAM.Project1\ICTEAM.Project1.csproj'
)
@timvw
timvw / gist:4277c67fa70004b15d20
Created May 2, 2015 20:05
Powershell coding style
<#
.SYNOPSIS
Cmdlet help is awesome. Autogenerate via template so I never forget.
.DESCRIPTION
.PARAMETER
.PARAMETER
.INPUTS
.OUTPUTS
.EXAMPLE