This file contains hidden or 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
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 |
This file contains hidden or 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 -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 => { | |
This file contains hidden or 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 Dog | |
attr_accessor :ears, :legs, :nose, :smell, :name, :number | |
@@number = 0 | |
@@names = [] | |
@@dogs = [] | |
def initialize(name) | |
@ears = 2 | |
@legs = 4 | |
@nose = 1 | |
@smell = "Stinky" |
This file contains hidden or 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
/* | |
Blink | |
Turns on an LED on for one second, then off for one second, repeatedly. | |
This example code is in the public domain. | |
*/ | |
void setup() { | |
// initialize the digital pin as an output. | |
// Pin 13 has an LED connected on most Arduino boards: |
This file contains hidden or 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
#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 | |
This file contains hidden or 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
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 |
This file contains hidden or 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
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: |
This file contains hidden or 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
#!/bin/sh | |
./sshuttle -r user@hostname 0.0.0.0/0 -vv |
This file contains hidden or 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
Time to determine if 433019240910377478217373572959560109819648647016096560523769010881172869083338285573756574557395862965095016483867813043663981946477698466501451832407592327356331263124555137732393938242285782144928753919588632679050799198937132922145084847 is prime (it is) using a ruby Miller-Rabin Primality test: | |
0m1.223s | |
This file contains hidden or 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
// 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"); | |
} |
OlderNewer