Skip to content

Instantly share code, notes, and snippets.

View AnthonyMastrean's full-sized avatar
🏡
Working remotely

Anthony Mastrean AnthonyMastrean

🏡
Working remotely
View GitHub Profile
@AnthonyMastrean
AnthonyMastrean / Get-TfsCodeClosure.ps1
Created February 1, 2014 18:47
TFS repository statistics
function Get-TfsCodeClosure {
<#
.SYNOPSIS
Report the relative degree of closure of a codebase.
.DESCRIPTION
Are you concerned that your codebase is a festering one? Want
proof? Then run this function at the solution root and watch as
it reports the number of check-ins per C# code file. This
function only works against TFS source control (and the working
@AnthonyMastrean
AnthonyMastrean / hotshow.ahk
Created February 10, 2014 22:17
Capture all keys pressed to display in a transparent overlay for use in pair programming or video capture
/*
-------------------------------------------------------
HotShow 1.0
-------------------------------------------------------
This program will show any pressed key or combination
of keys on screen in a very elegant way.
Perfect for people who creates video tutorials
and want to show which hotkeys they press during
@AnthonyMastrean
AnthonyMastrean / palette.rb
Created February 13, 2014 21:52
How to Choose Colours Procedurally
module ProceduralPalette
class Palette
end
end
@AnthonyMastrean
AnthonyMastrean / calculator.fs
Last active August 29, 2015 13:57
It only multiplies three numbers...
open FSharpx.Option
/// hour, a unit of time
[<Measure>] type h
/// megawatt, a unit of power
[<Measure>] type MW
/// pounds sterling, a unit of currency
[<Measure>] type ``£``
@AnthonyMastrean
AnthonyMastrean / amazon.js
Created July 16, 2014 14:18
Amazon Short Link Bookmarklet
javascript:window.location='http://www.amazon.com/dp/'+(document.getElementsByName('ASIN')[0]||document.getElementsByName('ASIN.0')[0]).value;
@AnthonyMastrean
AnthonyMastrean / birmingham.js
Created July 28, 2014 19:01
Terrible Birmingham tech ad
/*
For
Digital business
(tech cluster
growing in
"Greater Birmingham")==true;
*/
@AnthonyMastrean
AnthonyMastrean / batterymonitor.ps1
Created August 4, 2014 15:45
Battery Monitor and Event Log
Get-WmiObject -Class "BatteryStatus" -Namespace "root/WMI" | Export-Csv "batterymonitor.csv" -Append
@AnthonyMastrean
AnthonyMastrean / index.md
Created October 21, 2014 17:14
Epic Programming Rants
@AnthonyMastrean
AnthonyMastrean / ActiveProduct.cs
Last active August 29, 2015 14:08
Bloated Constructor
public class ActiveProduct
{
private readonly ActiveProductState State = ActiveProductState.Simulated;
private readonly SortedList<string, Environment> Environments = new SortedList<string, Environment>();
private readonly ProgramSlots AvailablePrograms = new ProgramSlots(this) { HIStartIndex = 0 };
private readonly ProgramSlots AccessoryPrograms = new ProgramSlots(this) { CanRemoveOverride = true, StartIndex = 4, IsAutoShifting = false };
private readonly ProgramSlots VirtualPrograms = new ProgramSlots(this) { IsVirtual = true, CanRemoveOverride = true, SlotConfig = Limit.None };
private readonly ProgramCalculator SlotCalculator = new ProgramCalculator(this, false);
private readonly ProgramCalculator VirtualCalculator = new ProgramCalculator(this, true);
private readonly DFSCalibration DFS = new DFSCalibration(this);
@AnthonyMastrean
AnthonyMastrean / graphit.ps1
Last active August 29, 2015 14:17
Create a Graphviz dot file from a set of Ant files (targets and depends)
param(
[Parameter(Mandatory = $true, ValueFromPipeline = $true)]
[string[]] $Path
)
BEGIN {
"digraph {"
}
PROCESS {