Skip to content

Instantly share code, notes, and snippets.

Matthew Hayter matthayter

Block or report user

Report or block matthayter

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@matthayter
matthayter / capslock.ahk
Last active Aug 1, 2017
Autohotkey: Use Caps Lock as both CTRL and Escape: Hold for CTRL; tap for Escape.
View capslock.ahk
SetCapsLockState Off
*CapsLock::
key=
Input, key, B C L1 T1, {Esc}
if (ErrorLevel = "Max")
if key {
Send {Ctrl Down}
Send {Blind}%key%
}
@matthayter
matthayter / monty_hall.js
Created Feb 17, 2016
A demonstration of the Monty Hall problem.
View monty_hall.js
function getRandomInt(min, max) {
return Math.floor(Math.random() * (max - min)) + min;
}
var monty = function(doSwitch) {
var tryCount = 10000;
var winCount = 0.0;
for (var i = 0; i < tryCount; i++) {
var car = getRandomInt(0, 3);
View Sudoku
import Data.Matrix
import Data.Maybe
import Data.List
import Data.Char
import Control.Monad
import qualified Data.Vector
type Puzzle = Matrix (Maybe Int)
puzzle = puzzleFromLines
@matthayter
matthayter / curl-format.txt
Created Jul 23, 2014
Curl timing-info config: To be run with curl -w "@curl-format.txt" -o /dev/null -s http://...
View curl-format.txt
time_namelookup: %{time_namelookup}\n
time_connect: %{time_connect}\n
time_appconnect: %{time_appconnect}\n
time_pretransfer: %{time_pretransfer}\n
time_redirect: %{time_redirect}\n
time_starttransfer: %{time_starttransfer}\n
----------\n
time_total: %{time_total}\n
\n
You can’t perform that action at this time.