Skip to content

Instantly share code, notes, and snippets.

# A CoffeeScript version of http://norvig.com/spell-correct.html
[fs, _] = [require("fs"), require("underscore")]
words = (text) -> text.toLowerCase().match /[a-z]+/g
train = (features) ->
model = {}
_.each features, (f) -> if model[f] then model[f] += 1 else model[f] = 1
model

Contract Killer

The popular open-source contract for web designers and developers by Stuff & Nonsense

  • Originally published: 23/12/2008
  • Revised date: 15/12/2013
  • Original post

Contract Killer

The popular open-source contract for web designers and developers by Stuff & Nonsense

  • Originally published: 23/12/2008
  • Revised date: 15/12/2013
  • Original post

@volkanunsal
volkanunsal / README.md
Created June 25, 2012 02:08
A better Rails template

A better Rails template

Disclaimer: I'm really opinionated about how Rails should work.

The default Rails template is boring. The Gemfile is a mess - it's not even in alphabetical order! Mainly, it's missing:

  • a better webserver than webrick
  • compass for consistent styling
  • factory_girl
@volkanunsal
volkanunsal / nodeconf_2011.md
Created May 7, 2011 17:19 — forked from mattpodwysocki/nodeconf_2011.md
a list of slides from nodeconf 2011
if __FILE__ == $0
puts "Run with: watchr #{__FILE__}. \n\nRequired gems: watchr rev"
exit 1
end
# --------------------------------------------------
# Convenience Methods
# --------------------------------------------------
def run(cmd)
puts(cmd)
ENV["WATCHR"] = "1"
system 'clear'
def growl(message)
growlnotify = `which growlnotify`.chomp
title = "Watchr Test Results"
puts message
image = message.match(/\s0\s(errors|failures)/) ? "~/.watchr_images/passed.png" : "~/.watchr_images/failed.png"
options = "-w -n Watchr --image '#{File.expand_path(image)}' -m '#{message}' '#{title}'"
system %(#{growlnotify} #{options} &)