Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env zsh
setopt extendedglob
[[ $XPLEASE ]] && set -x
if [[ -t 1 ]]; then
color_header=$(git config --get-color color.diff.meta bold)
color_hunk_header=$(git config --get-color color.diff.frag cyan)
color_new=$(git config --get-color color.diff.new green)
@Pondidum
Pondidum / program.cs
Created January 28, 2019 13:31
os specifciy config
var builder = new ConfigurationBuilder();
builder.AddJsonFile("appsettings.json")
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
builder.AddJsonFile($"appsettings.win.json");
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
builder.AddJsonFile($"appsettings.osx.json");
var config = builder.Build();
@Pondidum
Pondidum / debug.log
Created December 2, 2018 13:30
terraform instance_template debug log
2018/12/02 15:29:12 [INFO] Terraform version: 0.11.10 17850e9a55d33c43d7c31fd6ac122ba97a51d899
2018/12/02 15:29:12 [INFO] Go runtime version: go1.11.1
2018/12/02 15:29:12 [INFO] CLI args: []string{"C:\\ProgramData\\chocolatey\\lib\\terraform\\tools\\terraform.exe", "apply"}
2018/12/02 15:29:12 [DEBUG] Attempting to open CLI config file: C:\Users\Andy\AppData\Roaming\terraform.rc
2018/12/02 15:29:12 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2018/12/02 15:29:12 [INFO] CLI command args: []string{"apply"}
2018/12/02 15:29:12 [INFO] command: empty terraform config, returning nil
2018/12/02 15:29:12 [DEBUG] command: no data state file found for backend config
2018/12/02 15:29:12 [DEBUG] New state was assigned lineage "09482bc8-900b-e139-ff85-88a0ddbb8326"
2018/12/02 15:29:12 [INFO] command: backend initialized: <nil>
2018/10/18 14:30:54 [INFO] Packer version: 1.3.1
2018/10/18 14:30:54 Packer Target OS/Arch: windows amd64
2018/10/18 14:30:54 Built with Go Version: go1.11
2018/10/18 14:30:54 Using internal plugin for alicloud-ecs
2018/10/18 14:30:54 Using internal plugin for docker
2018/10/18 14:30:54 Using internal plugin for file
2018/10/18 14:30:54 Using internal plugin for lxc
2018/10/18 14:30:54 Using internal plugin for amazon-chroot
2018/10/18 14:30:54 Using internal plugin for cloudstack
2018/10/18 14:30:54 Using internal plugin for lxd
Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowFileExtensions -DisableOpenFileExplorerToQuickAccess
# auto hide tray icons
Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer -Name EnableAutoTray -Type DWord -Value 1
cinst chocolatey # installing chocolatey with chocolatey?!
cinst git.install
cinst atom
cinst nodejs.install
cinst diffmerge
cinst sql-server-express
#!/bin/bash
for file in $(find $1 *.cs -type f);
do
sed -b -i -r \
-e 's/using Microsoft.VisualStudio.TestTools.UnitTesting;/using Xunit;/g' \
-e 's/\[TestMethod\]/\[Fact\]/g' \
-e '/\[TestClass\]/d' \
-e '/\[TestCategory.*/d' \
-e '/\[Category.*/d' \
public class AggregateController
{
private readonly List<object> _uncommittedEvents;
private readonly Dictionary<Type, Action<object>> _handlers;
public AggregateController(object aggregate)
{
_uncommittedEvents = new List<object>();
_handlers =aggregate
@Pondidum
Pondidum / build.sh
Last active September 15, 2016 05:06
NAME='NScientist'
MODE=${1:-"Debug"}
dotnet restore
dotnet build "./src/$NAME" --configuration $MODE,
dotnet build "./src/$NAME.Tests" --configuration $MODE
dotnet test ."/src/$NAME.Tests" --configuration $MODE
dotnet pack ."/src/$NAME" --configuration $MODE --output ./build/deploy
@Pondidum
Pondidum / graph.sh
Last active September 12, 2016 17:42
Creates a nuget package dependency graph in graphviz dot language
# put the output in the box here: http://www.webgraphviz.com/
RESULT_FILE="graph.dot" # the output file
NAME_MATCH='Microsoft\.' # leave this as a blank string if you want no filtering
echo '' > $RESULT_FILE # clear out the file
echo 'digraph Dependencies {' >> $RESULT_FILE
echo ' rankdir=LR;' >> $RESULT_FILE # we want a left to right graph, as it's a little easier to read
# find all packages.config, recursively beaneath the path passed into the script
public class Scratchpad
{
[Fact]
public void When_testing_something()
{
var container = new Container(c =>
{
c.Scan(a =>
{