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 | |
# Tool to convert Google motion JPGs (MVIMG) to MP4 video files. | |
# | |
# requires exiftool utility (ie: `apt install exiftool`) | |
# requires exiftool gem (ie: `gem install exiftool`) | |
# | |
require 'exiftool' | |
files = Dir['*.jpg'] |
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 Dynamical | |
def should_not_explode(&block) | |
5.times { |n| yield n } | |
end | |
define_method :works_fine do |&block| | |
5.times { |n| block.call(n) } | |
end | |
def also_works_fine(&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
module God | |
module Conditions | |
class RestartFilePresent < PollCondition | |
attr_reader :restart_file | |
def initialize | |
super | |
end | |
def restart_file=(file) |
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 "rubygems" | |
require "gems" | |
require "json" | |
require "retryable" | |
gems = [] | |
File.open("gems", "r") do |f| | |
while (l = f.gets) do | |
gems << l.strip() | |
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
#!/usr/bin/env ruby | |
require 'net/http' | |
require 'pp' | |
require 'benchmark' | |
Pleading = Struct.new(:no, :position ,:person, :party, :replik, :content, :point) | |
Point = Struct.new(:no, :title) | |
class DocumentParsing | |
POINT_REGEX = /^(?<no>\d+)\s+\§\s+(?<title>.+?)\s?$/ |
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 | |
# quick and dirty thin init script | |
# | |
# path for thin | |
thin = "/home/someuser/.rvm/gems/ruby-1.8.7-p72@global/bin/thin" | |
config = "config/config.ru" | |
# which dir to run from | |
path = "/srv/thisapp" |