This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open Parser;; | |
open Stringutil;; | |
type t = String of string | List of t list | |
let rec of_module m = | |
List (String "module" :: of_definitions m) | |
and of_definitions ds = | |
List.map of_definition ds |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git diff --name-status head~3000..head | grep '^D' | awk '{print $2}' | while read f; do git log -1 --pretty="format:%H" -- "$f"; done > temp.txt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module RenderToHTML | |
def self.book | |
[title, css, body].join("\n") | |
end | |
private | |
def self.title | |
commit_hash = `git log -1 --pretty="format:%H"` | |
%{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Has your OS/FS/disk lost your data? | |
# cd to the directory containing your project repositories and run the command | |
# below. (It's long; make sure you get it all.) It finds all of your git repos | |
# and runs paranoid fscks in them to check their integrity. | |
(set -e && find . -type d -and -iname '.git' | while read p; do (cd "$(dirname "$p")" && (set -x && git fsck --full --strict)); done) && echo "OK" | |
# I have 81 git repos in my ~/proj directory and had no errors. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find $(manpath | tr ':' '\n') -iname '*.1' | xargs cat | (LC_CTYPE=C tr -C '[:alnum:]-_' '\n') | egrep '^--[\-_[:alnum:]]+$' | sort | uniq -c | sort -n |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "erb" | |
require "pathname" | |
DOT_TEMPLATE=<<-END | |
digraph { | |
size="20,20"; | |
overlap=false; | |
sep=0.4; | |
graph [fontname=Helvetica,fontsize=10]; | |
node [fontname=Helvetica,fontsize=10]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Turning The Design Clock Back | |
Object-oriented design principles haven't had the effect we hoped for. The | |
SOLID principles are excellent design guidelines, but experience shows that | |
programmers find them difficult to follow. What do we do about this? | |
Surprisingly, the Structured Design literature of forty years ago contains | |
compelling solutions to many current design problems. They're simple and easy | |
to understand, but were lost in the noise as OO rose to popularity. We'll | |
reinterpret these simple design ideas in a modern context, finding that many of | |
our most promising new design ideas resemble them. Rapid web application |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(Chapters marked with * are already written. This gets reorganized constantly | |
and 10 or so written chapters that I'm on the fence about aren't listed.) | |
Programmer Epistemology | |
* Dispersed Cost vs. Reduced Cost | |
* Verificationist Fallacy | |
* Mistake Metastasis | |
The Overton Window | |
Epicycles All The Way Down | |
The Hyperspace Gates Were Just There |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
failbowl:selecta(scoring_redesign) $ ruby ../readygo/readygo.rb --compare benchmark.rb | |
.!.!.!.!.!.!.!.!..!.!.!.!.!.!.!.!.!.!...!.!.!.!.!.!.!.!............................................................................................................. | |
filtering non-matching | |
Baseline: | X-----------| | |
Current: | X--------- | | |
0 6.848 ms | |
filtering matching exactly | |
Baseline: | X-------------------| |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
it "requires an amount_charged greater than 0" do | |
order = FactoryGirl.build(:order, :amount_charged => 0) | |
order.valid?.should == false | |
order.errors[:amount_charged].should == ["must be greater than 0"] | |
end |