This file contains 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
class GameOfLife < Chingu::GameState | |
CELL_SIZE = 4 | |
@@tick =0 | |
def initialize | |
super | |
@grid = generate_grid | |
self.input={:left_mouse_button=>:set_grid_block,:space=>:toggle_running, | |
:right_mouse_button=>:unset_grid_block,:z=>:reset,:n=>:update_grid} | |
@running = false |
This file contains 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
*.swp |
This file contains 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
http = require 'http' | |
fs = require 'fs' | |
URL = require 'url' | |
class Downloader | |
@download_image:(image_url, destination, callback) | |
options = URL.parse image_url | |
http.get(options, (response) -> | |
fileStream = false |
This file contains 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
gem "pony" |
This file contains 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
#!/usr/bin/env ruby | |
require 'csv' | |
require 'json' | |
csv_data = CSV.read ARGV[0] | |
headings = csv_data[0].compact | |
result = [] | |
csv_data[1..-1].each do |row| |
This file contains 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
[alias] | |
s = status | |
cma = commit -am | |
cm = commit -m | |
cont = rebase --continue | |
dumbass = commit --amend | |
forget = update-index --assume-unchanged | |
unforget = update-index --no-assume-unchanged | |
root = rev-parse --show-toplevel | |
lg = "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%C(bold blue)<%an>%Creset' --abbrev-commit" |
This file contains 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
#!/usr/bin/env ruby | |
def run | |
dir = ARGV[0] || Dir.pwd | |
Dir[File.join(dir,'*.jpg')].each do |file| | |
gps = gps_for_file file | |
if gps | |
puts "#### #{File.basename file} -> http://www.google.com/maps/place/#{gps[0]},-#{gps[1]}" |
This file contains 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
for %i in (ruby python ftp debug wscript cscript powershell javac) do where %i |
This file contains 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
var images = $('img[src$=".jpg"]'); | |
var frame_ids = $.map(images, function(el, index){ return $(el).attr("frameid")}); | |
var urls = $.map(frame_ids, function(el, index){ return "/Ajax/Zoom/?frameid=" + el}); | |
var responses = []; | |
$.each(urls, function(index, el){ resp = $.get(el, null, function(data){responses.push(data)}) }); | |
function getImagesUrlsFromServerResponses(responses) | |
{ |