Skip to content

Instantly share code, notes, and snippets.

View Workshop2's full-sized avatar

Simon Colmer Workshop2

  • London, UK
View GitHub Profile
choco install googlechrome -y
choco install firefox -y
choco install git -y
choco install github-desktop -y
choco install poshgit -y
choco install vscode -y
choco install notepadplusplus -y
choco install paint.net -y
choco install 7zip -y
choco install lastpass -y
@Workshop2
Workshop2 / setDailyWallpaper.ps1
Created May 15, 2016 11:24
Set wallpaper to today's Bing wallpaper (en-GB)
$wallpaperOutput = "$env:USERPROFILE\Pictures\wallpaper.jpg"
Write-Output "Downloading data feed..."
$wallpaperData = "http://www.bing.com/HPImageArchive.aspx?format=js&idx=0&n=1&mkt=en-GB"
$json = (Invoke-WebRequest $wallpaperData -UseBasicParsing) | ConvertFrom-Json
$wallpaperUrl = "http://www.bing.com" + $json.images.urlbase + "_1920x1080.jpg"
Write-Output "Generated wallpaper URL: $wallpaperUrl"
@Workshop2
Workshop2 / SetMonthlyWallpaper.ps1
Created May 15, 2016 11:18
Set a wallpaper based on date (Bing wallpapers)
$targetDate = (Get-Date).ToString("yyyyMM01")
Write-Host "targetDate: $targetDate"
$wallpaperOutput = "$env:USERPROFILE\Pictures\wallpaper.jpg"
Write-Output "Downloading data feed..."
$wallpaperData = "http://www.bing.com/gallery/home/browsedata?z=0"
$json = (Invoke-WebRequest $wallpaperData -UseBasicParsing).Content
Write-Output "Parsing JSON..."
@Workshop2
Workshop2 / delete-old-branches
Created November 17, 2015 12:19
Remove all local branches
git checkout master; git branch | sed -e '/master/d' -e 's/^/git branch -D /' | bash
@Workshop2
Workshop2 / ObjectCacheExtensionTests.cs
Last active August 29, 2015 14:22
ObjectCache AddOrGetExisting extension method via Tasks and Actions/Funcs
public static class ObjectCacheExtensionTests
{
public class when_get_or_add_existing_when_key_doesnt_exist : SpecsFor<MemoryCache>
{
private readonly string _expectedResult = "This is what should be returned";
private readonly string _key = "myKey";
private string Result { get; set; }
protected override void InitializeClassUnderTest()
{
@Workshop2
Workshop2 / SpecsFor MVC with .NET 4.6
Created May 22, 2015 07:20
SpecsFor MVC with .NET 4.6
// SpecsFor MVC doesn't seem to pick up the correct MSBUILD to use
// when it tries to compile your web app to host in IIS express.
// If you add a reference in your Test project to "Microsoft.Build.Utilities.v12.0"
// you can then use the "ToolLocationHelper" to get the MSBUILD.exe for a VS version
string msBuild = ToolLocationHelper.GetPathToBuildToolsFile("msbuild.exe", "14.0"); // 14.0 hard coded for VS2015
var config = new SpecsForMvcConfig();
config.UseIISExpress()
.With(webProjectDirectory, solutionDirectory)
@Workshop2
Workshop2 / Chocolatey Install Script
Last active August 29, 2015 14:19
Chocolatey Install Script
cinst googlechrome -y
cinst revo.uninstaller -y
cinst dropbox -y
cinst notepadplusplus -y
cinst spotify -y
cinst paint.net -y
cinst picasa -y
cinst foxitreader -y
cinst putty -y
cinst nodejs -y