Skip to content

Instantly share code, notes, and snippets.

@jpoehls
jpoehls / example.ps1
Created April 28, 2015 14:45
Symlink support in PowerShell V5 *-Item cmdlets
### SYMBOLIC LINK FILES
# Create a new symbolic link file named MySymLinkFile.txt in C:\Temp which links to $pshome\profile.ps1
cd C:\Temp
New-Item -ItemType SymbolicLink -Name MySymLinkFile.txt -Target $pshome\profile.ps1 # File
# Target is an alias to the Value parameter
# Equivalent to above
New-Item -ItemType SymbolicLink -Path C:\Temp -Name MySymLinkFile.txt -Value $pshome\profile.ps1
# Equivalent to above
# Kill all background jobs when this script exits
# http://stackoverflow.com/a/2173421
trap 'trap - SIGTERM && kill -- -$$' SIGINT SIGTERM EXIT
which gin
if [ $? -ne 0 ]; then
go get github.com/codegangsta/gin
fi
which goconvey
@jpoehls
jpoehls / analytics.html
Created August 4, 2014 15:46
Go master pages example
<!-- ANALYTICS HERE -->
param($installPath, $toolsPath, $package, $project)
$sln = get-item dte:/solution;
$slnName = ( $sln.FullName | split-path -leaf ) -replace '\..+$','';
$menuItems = @(
# list any menu items your module adds here
#
# e.g.:
new-item 'dte:/commandbars/menu bar/help' `
PS C:\code\chris> hg branches
PS C:\code\chris> echo first > notes.txt
PS C:\code\chris> ls
Directory: C:\code\chris
@jpoehls
jpoehls / case.md
Last active August 29, 2015 13:56
camget - chmod "invalid argument" error on Windows
  1. Drag and dropped "notes" (a text file) into the web UI.

  2. camtool describe sha1-9bc9a500f1cb6e6afc789311cb5377f6d36a5cee

     {
       "meta": {
         "sha1-9bc9a500f1cb6e6afc789311cb5377f6d36a5cee": {
           "blobRef": "sha1-9bc9a500f1cb6e6afc789311cb5377f6d36a5cee",
           "camliType": "permanode",
           "size": 548,
    

"permanode": {

Tracing route to google.com [74.125.227.142]
over a maximum of 30 hops:
1 * * * Request timed out.
2 12 ms 26 ms 11 ms tge7-2.kyletx0501h.texas.rr.com [66.68.5.117]
3 16 ms 10 ms 39 ms tge0-11-0-6.ausutxla01r.texas.rr.com [24.27.13.114]
4 19 ms 14 ms 15 ms agg22.dllatxl301r.texas.rr.com [24.175.41.46]
5 18 ms 18 ms 14 ms ae-8-0.cr0.dfw10.tbone.rr.com [66.109.6.52]
6 24 ms 19 ms * 107.14.19.97
7 26 ms 16 ms 14 ms 74.125.48.65
freetrace to Google.com, 64 hops max, 52 byte packets
1 - 192.168.124.1
2 ******************** Request timeout
3 - tge7-2.kyletx0501h.texas.rr.com (66.68.5.117)
4 - tge0-11-0-7.ausutxla01r.texas.rr.com (24.175.41.72)
5 - agg22.dllatxl301r.texas.rr.com (24.175.41.46)
6 ******************** Request timeout
7 - ae2.pr1.dfw10.tbone.rr.com (107.14.17.236)
8 - 74.125.48.65
@jpoehls
jpoehls / AnotherCulture.cs
Created January 23, 2014 18:01
Execute .NET unit test (or any) code under a specific culture.
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
/// <summary>
/// Makes it easy to execute test code under a specific culture.