Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

Constitution of a Charitable Incorporated Organisation whose only voting
members are its charity trustees
(‘Foundation’ model constitution)
Date of constitution (last amended):
...........................................................................
1. Name
@threedaymonk
threedaymonk / recipes.txt
Last active June 2, 2016 15:43
BBC Food recipe URLs
http://www.bbc.co.uk/food/recipes/10minutepizza_87314
http://www.bbc.co.uk/food/recipes/15_minute_pasta_33407
http://www.bbc.co.uk/food/recipes/3d_biscuits_29555
http://www.bbc.co.uk/food/recipes/3wayswithlemoncurd_67266
http://www.bbc.co.uk/food/recipes/_81487
http://www.bbc.co.uk/food/recipes/aberdeenbutteriesrow_92370
http://www.bbc.co.uk/food/recipes/abundant_steamed_sea_22932
http://www.bbc.co.uk/food/recipes/acaciahoneyglazedchi_83634
http://www.bbc.co.uk/food/recipes/ackeeandsaltfish_86812
http://www.bbc.co.uk/food/recipes/aclassicspongecakewi_9406
@threedaymonk
threedaymonk / annotate-failures.rb
Created March 29, 2016 08:59
Annotate failing Cucumber scenarios with @broken
failures = {}
ARGF.read.split(/\n/).each do |line|
matches = line.match(/\Acucumber ([^:]+):(\d+)/) or next
(failures[matches[1]] ||= []) << matches[2].to_i - 1
end
failures.each do |file, indices|
lines = File.readlines(file)
indices.reverse.each do |index|
indentation = lines[index][/\A\s+/]
@threedaymonk
threedaymonk / a
Last active January 20, 2016 11:30
Number of separate copies/versions of each npm module in the node_modules hierarchy
Unique versions of each module
8 glob
8 async
7 qs
7 lodash
7 commander
6 source-map
5 uglify-js
5 strip-ansi
@threedaymonk
threedaymonk / benchmarking.rb
Created October 8, 2015 09:43
Ruby benchmarking example
require "benchmark"
Benchmark.benchmark do |b|
b.report("Some job"){ do_some_job }
b.report("Another job"){ do_another_job }
end
if (!Function.prototype.bind) {
Function.prototype.bind = function bind(thisValue){
var func = this;
return function() {
return func.apply(thisValue, arguments);
}
}
}
@threedaymonk
threedaymonk / animation.js
Created March 15, 2015 18:30
Alternative animation implementation for beta.jisho.org, using an easing function to accelerate towards the middle of a stroke, and decelerate at the end
var Animation = Class(function Animation() {});
Animation.mixin(Canvas);
Animation.prototype.extend(Event.Listener);
Animation.prototype.extend({
reset: function() {
this.relativePosition = 0;
this.maxPosition = this.totalFrames - 1;
@threedaymonk
threedaymonk / .gitignore
Last active January 3, 2016 22:29
Little Schemer group, chapter 1
*.pdf
*.dot
@threedaymonk
threedaymonk / avoid.md
Last active December 18, 2015 14:09
A list of overly-generic terms to avoid when naming variables and resources. More to come as I find them.
  • type
  • state
  • status
  • data (yes, and datum, datas, etc.)
  • correct, especially in tests. What is correctness in this context?
  • object
@threedaymonk
threedaymonk / _problem.md
Last active December 16, 2015 07:28
Hoodlums exercise suggested by Andres Löh.

From http://www.meetup.com/hoodlums/events/91349692/

Define a function cat that takes an arbitrary number of strings and returns the concatenation of all strings. You'll need the FlexibleInstances extension (but should not need any others). When calling in GHCi, you will have to annotate the result type of the function. Examples:

> cat :: String 
"" 
> cat "foo" "bar" :: String 
"foobar" 
> cat "Haskell" "Hoodlums" "Meetup" :: String