Skip to content

Instantly share code, notes, and snippets.

View connorjclark's full-sized avatar

Connor Clark connorjclark

View GitHub Profile
def time_it(&block)
before = Time.now
block.call()
Time.now - before
end
def display_time(&block)
puts "time took: #{time_it(&block)} seconds"
end
require 'filewatcher'
system('clear')
puts 'and now my watch begins ...'
FileWatcher.new('.').watch() do |filename, event|
if filename.include? '.rb' and filename != 'watch.rb'
system('clear')
puts "time is #{Time.now.strftime('%I:%M:%S %P')}"
puts `ruby #{filename}`
@connorjclark
connorjclark / gist:5795475
Created June 17, 2013 08:35
amitp Polygonal Map Generation - rendering the outermost polygons
//Written by Hoten
//www.hotengames.com
//feel free to use
for (Center c : centers) {
g.setColor(key[c.index]);
//only used if Center c is on the edge of the graph. allows for completely filling in the outer polygons
Corner edgeCorner1 = null;
Corner edgeCorner2 = null;