Skip to content

Instantly share code, notes, and snippets.

@stack
stack / copy.ps1
Created November 11, 2010 17:56
A script for copying files from a corrupt hard drive
$source = $args[0];
$dest = $args[1];
$files = Get-ChildItem "$source" -recurse
foreach($file in $files) {
if ($file.psiscontainer) {
$common_directory = $file.FullName.Replace($source, "")
$new_directory = $dest + $common_directory
Write-Host "Creating directory $new_directory"
New-Item $new_directory -type directory
@stack
stack / gist:486408
Created July 22, 2010 18:52
A script for switching between git profiles
#!/bin/bash
case "$1" in
'place1')
git config --global user.name "Your Name"
git config --global user.email foo@bar.com
;;
*)
git config --global user.name "Your Other Name"
git config --global user.email bar@baz.com