Skip to content

Instantly share code, notes, and snippets.

local isEmpty = function(t)
return next(t) == nil
-- for k,v in pairs(t) do
-- return false
-- end
-- return true
end
local System = {
@Pondidum
Pondidum / Test.cs
Created October 18, 2015 21:11
Structuremap response
[Fact]
public void Can_resolve_action()
{
Action<TokenizerConfigurator> action = config =>
{
/* whatever */
};
var container = new Container(c =>
{
public class Scratchpad
{
[Fact]
public void When_testing_something()
{
var container = new Container(c =>
{
c.Scan(a =>
{
@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
@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
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
#!/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' \
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
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
@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>