Skip to content

Instantly share code, notes, and snippets.

View tomkersten's full-sized avatar

Tom Kersten tomkersten

View GitHub Profile

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results

:sunny:
:zap:
:leaves:
:lipstick:
:cop:
:wheelchair:
:fish:
:hammer:
:moneybag:
:calling:
#!/usr/bin/ruby
require 'rubygems'
require 'codefumes_harvester'
def cuc_success?
ENV['CUC_RET'] == '0'
end
def spec_success?
#!/usr/bin/ruby
require 'rubygems'
require 'codefumes_harvester'
def ant_success?
ENV['ANT_RET'] == '0'
end
pub_key = ENV['CF_PUBLIC_KEY']
@tomkersten
tomkersten / go.rb
Created June 26, 2010 02:31 — forked from roykolak/go.rb
require 'codefumes_harvester'
include CodeFumesHarvester
# Start the JavaScript Specs build...
QuickBuild.start('javascript specs');
# ...
# if it failed...
QuickBuild.finish('javascript specs', 'failed');

Poor Man's Deploy

  • Start a Sinatra server on port 4000
  • GET / to that server triggers a git pull and mod_rails restart
  • Hit port 4000 locally after pushing

Why?

@tomkersten
tomkersten / license
Created January 28, 2010 03:44 — forked from defunkt/license
#!/bin/sh -e
# Usage: license
# Prints an MIT license appropriate for totin' around.
#
# $ license > COPYING
#!/bin/sh
echo "Copyright (c) `date +%Y` Chris Wanstrath
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
@tomkersten
tomkersten / stats.rb
Created September 15, 2009 20:33 — forked from mojombo/stats.rb
# Run the given block +num+ times and then print out the mean, median, min,
# max, and stddev of the run. For example:
#
# irb> stats(10) { sleep(rand / 100) }
# mean: 5.99ms
# median: 6.76ms
# min: 1.49ms
# max: 9.28ms
# stddev: 2.54ms
def stats(num)