Skip to content

Instantly share code, notes, and snippets.

View carlzulauf's full-sized avatar

Carl Zulauf carlzulauf

  • Unabridged Software
  • Denver, CO
View GitHub Profile
#!/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"
@carlzulauf
carlzulauf / gist:7526708
Last active December 28, 2015 16:09 — forked from Grundell/gist:7526597
#!/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?$/
require "rubygems"
require "gems"
require "json"
require "retryable"
gems = []
File.open("gems", "r") do |f|
while (l = f.gets) do
gems << l.strip()
end
@carlzulauf
carlzulauf / restart_file_present.rb
Last active January 4, 2016 08:09 — forked from technicalpickles/restart_file_touched.rb
god/conditions/restart_file_present
module God
module Conditions
class RestartFilePresent < PollCondition
attr_reader :restart_file
def initialize
super
end
def restart_file=(file)
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)
#!/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']