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
from iron_worker import * | |
import zipfile | |
import shutil | |
import airbrakepy | |
import xmlbuilder | |
# here we have to include dependencies. | |
worker_dir = os.path.dirname(__file__) + '/airbrake' |
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
Rubinius Crash Report #rbxcrashreport | |
Error: signal SIGSEGV | |
[[Backtrace]] | |
ruby[0x5d95cc] | |
/lib/libc.so.6(+0x349f0)[0x7fcc4984f9f0] | |
[0x7fcc3c07a0d0] | |
[[System Info]] |
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
Rubinius Crash Report #rbxcrashreport | |
Error: signal SIGSEGV | |
[[Backtrace]] | |
ruby[0x5d95cc] | |
/lib/libpthread.so.0(+0xf270)[0x7f016c04c270] | |
[0x7f0154139c20] | |
[[System Info]] |
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
require 'open-uri' | |
require 'json' | |
require 'cgi' | |
uri = URI('http://api.freebase.com/api/service/mqlread') | |
uri.query = "query=" + CGI.escape({ | |
query: [{ | |
id: nil, | |
name: nil, | |
type: '/film/film', |
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
require 'rack' | |
trap(:INT){ Rack::Handler::WEBrick.shutdown } | |
Rack::Handler::WEBrick.run(lambda{|env| | |
[200, {'Content-Type' => 'text/plain'}, [`fortune`]] | |
}, Port: 7000) |
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
divmod = (num1, num2) -> | |
[num1 / num2, num1 % num2] | |
formatInterval = (start) -> | |
total = parseInt((Date.now() - start) / 1000, 10) | |
[hours, rest] = divmod(total, 60 * 60) | |
[minutes, seconds] = divmod(rest, 60) | |
sprintTime(hours, minutes, seconds) | |
sprintTime = -> |
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 Hash | |
def true_of?(key, &block) | |
TrueOf.new(self, key).instance_eval(&block) | |
end | |
end | |
class TrueOf | |
attr_reader :key, :value | |
def initialize(hash, key, &block) |
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
require 'parslet' | |
class PdfParser < Parslet::Parser | |
rule(:spaces) { match('\s').repeat(1) } | |
rule(:spaces?) { spaces.maybe } | |
rule(:integer) { match('[0-9]').repeat } | |
rule(:separator) { str(":") } | |
rule(:slash) { str("/") } | |
rule(:rciwn_number) { integer >> slash >> integer } | |
rule(:rciwn) { str("Number RCiWN") >> separator >> spaces? >> rciwn_number.as(:number) } |
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
module FXC | |
class Controller < Ramaze::Controller | |
layout :main | |
engine :Etanni | |
trait js: [ | |
'/js/jquery.min.js', | |
'/js/modernizr.foundation.js', | |
'/js/jquery.reveal.js', | |
'/js/jquery.orbit-1.3.0.js', |
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 | |
require 'yaml' | |
ARGV.each do |path| | |
YAML::ENGINE.yamler = 'syck' | |
obj = YAML.load_file(path) | |
YAML::ENGINE.yamler = 'psych' | |
File.open(path, 'w+'){|io| io.write(obj.to_yaml) } | |
end |