Skip to content

Instantly share code, notes, and snippets.

View rcook's full-sized avatar

Richard Cook rcook

View GitHub Profile
@rcook
rcook / CustomEpilogueAndPrologue.diff
Last active March 30, 2020 05:45
Instrumenting IL generation in Mono's C# compiler
From 4ba47528a583a47f38c2d9f1f9bff71b3b6a37e2 Mon Sep 17 00:00:00 2001
From: Richard Cook <[email protected]>
Date: Fri, 1 Oct 2010 13:17:00 -0700
Subject: [PATCH] Emit custom prologue and epilogue code and top and bottom of each method body
---
mcs/mcs/dmcs.csproj | 3 ++-
mcs/mcs/gmcs.csproj | 3 ++-
mcs/mcs/gmcs.exe.sources | 1 +
mcs/mcs/instrumentation.cs | 39 +++++++++++++++++++++++++++++++++++++++
@rcook
rcook / LICENSE
Last active December 24, 2023 00:41
Simulating packet loss with iptables/ipfw
The MIT License (MIT)
Copyright (c) 2010 Richard Cook
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
@rcook
rcook / LICENSE
Last active March 30, 2020 05:46
Dump tags in Jekyll static web site
The MIT License (MIT)
Copyright (c) 2015 Richard Cook
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
@rcook
rcook / LICENSE
Last active March 30, 2020 05:46
Just like a warm blanket
The MIT License (MIT)
Copyright (c) 2015 Richard Cook
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
@rcook
rcook / LICENSE
Last active March 30, 2020 05:46
Example doctest in GitHub API client
The MIT License (MIT)
Copyright (c) 2016 Richard Cook
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
@rcook
rcook / LICENSE
Last active March 30, 2020 05:46
Code snippets to accompany Yesod/Hakyll article
The MIT License (MIT)
Copyright (c) 2016 Richard Cook
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
@rcook
rcook / gist:ebee70c4d9ba1ccaae67400ce89bf978
Created June 5, 2016 01:47 — forked from NathanHowell/gist:5435345
Simple Warp server that can be gracefully shutdown over HTTP.
{-# LANGUAGE OverloadedStrings #-}
module Main (main) where
import Control.Concurrent (forkIO)
import Control.Concurrent.STM
import Control.Monad (when)
import Control.Monad.Trans (liftIO)
import Network.HTTP.Types
import Network.Wai as Wai
@rcook
rcook / Classify0.hs
Last active March 30, 2020 05:46
Haskell translation of classify0 function from "Machine Learning in Action"
module Classify0 where
import qualified Data.List as L
import qualified Data.Map as M
import qualified Data.Vector as V
import qualified Data.Vector.Storable as VS
import Numeric.LinearAlgebra
import LAUtil
@rcook
rcook / minted.py
Created January 2, 2017 00:50 — forked from jepio/minted.py
Pandoc filter to use minted for syntax highlighting
#!/usr/bin/env python3
'''
Filter to wrap Pandoc's CodeBlocks into minted blocks when using latex.
Pandoc's `fence_code_attributes` can be used to provide:
- the language (first class)
- minted's argumentless options (following classes)
- minted's options with arguments (attributes)
'''
@rcook
rcook / .gitignore
Last active July 30, 2017 22:04
backpack-app
/.stack-work/
/foo-indef/
/foo-int/
/foo-string/
/main/