Skip to content

Instantly share code, notes, and snippets.

View joeduffy's full-sized avatar
💭
🤔

Joe Duffy joeduffy

💭
🤔
View GitHub Profile
@joeduffy
joeduffy / PulumiPolicy.yaml
Last active November 20, 2020 05:41
AWS IAM Access Analyzer, Meet Pulumi CrossGuard
description: A policy pack that runs AWS IAM Access Analyzer during your deployments.
runtime: nodejs
@joeduffy
joeduffy / Pulumi.yaml
Last active October 20, 2019 22:35
A serverless website with dynamic hit counter on Azure
name: page-counter-az
runtime: nodejs
description: A page counter on Azure
@joeduffy
joeduffy / Pulumi.yaml
Last active January 10, 2022 22:31
Website hit counter using AWS DynamoDB, API Gateway, and Lambda
name: page-counter
runtime: nodejs
description: A page counter
CSC=dotnet compile-csc
DOTNET=/usr/local/share/dotnet/shared/Microsoft.NETCore.App/1.0.0-rc2-3002702
CSREFS=\
--reference=$(DOTNET)/mscorlib.ni.dll \
--reference=$(DOTNET)/System.Runtime.dll \
--reference=$(DOTNET)/System.Console.dll
CSFLAGS=\
--emit-entry-point \
--warnings-as-errors \
@joeduffy
joeduffy / ndisasm.bat
Created December 11, 2015 17:59
A handy .NET disassembler script
@ECHO OFF
REM A handy, dandy script for disassembling .NET programs.
SETLOCAL EnableDelayedExpansion
ECHO .NET Program Disassembler
ECHO =========================
REM Pluck out arguments and validate paths.
SET BINARY=%1
IF [%BINARY%]==[] (
ECHO error: missing program binary to disassemble
@joeduffy
joeduffy / teariface.go
Created July 18, 2015 15:40
Breaking Go memory safety by violating concurrency safety (#2: interfaces).
// teariface.go
// A simple demonstration of breaking Go memory safety by violating concurrency
// safety. We alias an interface variable which is of course multiple words;
// the net result is the itable pointer and target object pointer end up
// mismatched, triggering undefined behavior (wrong results, AVs, etc).
package main
import (
"fmt"
"runtime"
@joeduffy
joeduffy / tear.go
Created July 17, 2015 22:24
Breaking Go memory safety by violating concurrency safety.
// tear.go
// A simple demonstration of breaking Go memory safety by violating concurrency
// safety. We alias a shared slice variable -- which is a multi-word variable --
// and then reads/write that shared variable in parallel between Goroutines.
// If "torn slice: ..." is printed, something VeryBad(tm) has occurred...
package main
import (
"fmt"
"runtime"