Skip to content

Instantly share code, notes, and snippets.

View jbfink's full-sized avatar
💭
we have statuses now? is this AOL?

John Fink jbfink

💭
we have statuses now? is this AOL?
View GitHub Profile
Worker #28990: starting unit #1190 (graphics_magick/processing)
Worker #28745: failed unit #1195 (graphics_magick/processing) in 283.102081 seconds
/var/lib/gems/1.8/gems/cloud-crowd-0.5.0/lib/cloud_crowd/action.rb:77:in ``'/usr/local/cloud-crowd/actions/graphics_magick.rb:25:in `run_step'/usr/local/cloud-crowd/actions/graphics_magick.rb:15:in `process'/usr/lib/ruby/1.8/fileutils.rb:1421:in `inject'/usr/local/cloud-crowd/actions/graphics_magick.rb:15:in `each'/usr/local/cloud-crowd/actions/graphics_magick.rb:15:in `inject'/usr/local/cloud-crowd/actions/graphics_magick.rb:15:in `process'/var/lib/gems/1.8/gems/cloud-crowd-0.5.0/lib/cloud_crowd/worker.rb:79:in `run_work_unit'/var/lib/gems/1.8/gems/cloud-crowd-0.5.0/lib/cloud_crowd/worker.rb:77:in `chdir'/var/lib/gems/1.8/gems/cloud-crowd-0.5.0/lib/cloud_crowd/worker.rb:77:in `run_work_unit'/var/lib/gems/1.8/gems/cloud-crowd-0.5.0/lib/cloud_crowd/worker.rb:101:in `run'/var/lib/gems/1.8/gems/cloud-crowd-0.5.0/lib/cloud_crowd/node.rb:60:in `POST /work'/var/lib/gem
#!/usr/bin/env ruby -rubygems
require 'restclient'
require 'json'
#note that the original trench.rb file has hundreds of TIFFs for the input; I've truncated this one.
RestClient.post('http://localhost:9173/jobs',
{:job => {
class Dog
attr_accessor :ears, :legs, :nose, :smell, :name, :number
@@number = 0
@@names = []
@@dogs = []
def initialize(name)
@ears = 2
@legs = 4
@nose = 1
@smell = "Stinky"
@jbfink
jbfink / blink.pde
Created February 19, 2011 00:53
arduino blink code
@jbfink
jbfink / gist:953397
Created May 3, 2011 14:12
putting out emails from eventbrite csv
#this one worked!
require 'csv'
CSV.open('/tmp/orders.csv', 'r', ',') do |row|
File.open('/tmp/orders.txt', 'a') do |write|
write.puts row[-2]
end
end
@jbfink
jbfink / gist:953519
Created May 3, 2011 15:21
grep patterns for macids
file = File.read('list.txt')
file.scan(/\s[\S]{9}\s/)
array = file.scan(/\s[\S]{9}\s/)
array.each do |wtf|
# I cannot believe I did this....
# and it worked.
wtf.chop!.reverse!.chop!.reverse!
end
File.open('isolated.txt', 'a') do |write|
write.puts array
@jbfink
jbfink / pyduino-console
Created May 18, 2011 18:47
python arduino console
import serial
import time
baudrate = raw_input("Please enter the required baud rate:")
## You need to add the locations for your system, i.e. COM* for Windows, /dev/tty* for Nix systems
locations=['/dev/ttyACM0']
for device in locations:
try:
@jbfink
jbfink / gist:1233767
Created September 22, 2011 00:56
sshutle startup script
#!/bin/sh
./sshuttle -r user@hostname 0.0.0.0/0 -vv
@jbfink
jbfink / gist:1563612
Created January 5, 2012 03:46
ruby miller-rabin probability test results
Time to determine if 433019240910377478217373572959560109819648647016096560523769010881172869083338285573756574557395862965095016483867813043663981946477698466501451832407592327356331263124555137732393938242285782144928753919588632679050799198937132922145084847 is prime (it is) using a ruby Miller-Rabin Primality test:
0m1.223s
@jbfink
jbfink / gist:1590983
Created January 10, 2012 20:25
fizzbuzz this dammit
// Add an else statement in case the number is divisible by 5.
// for the numbers 1 through 20,
// this works! gah.
for (i=1; i<=20; i++) {
// if the number is divisible by 3 and 5, write "FizzBuzz"
if ( i % 3 === 0 && i % 5 === 0) {
console.log("FizzBuzz");
}