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 'time' | |
def get_date_range(start_date, end_date) | |
start_ts = Time.parse start_date | |
end_ts = Time.parse end_date | |
if (start_ts > end_ts) | |
ts = start_ts |
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 'rubygems' | |
require 'redis/connection/hiredis' | |
require 'redis' | |
require 'json' | |
require 'socket' | |
require 'getoptlong' | |
require 'uri' | |
require 'logger' |
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 class to read your most recent notes from icloud | |
# @oogali | |
# | |
require 'rubygems' | |
require 'net/imap' | |
require 'time' | |
require 'nokogiri' | |
require 'mail' |
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 'net/http' | |
namespace :server do | |
ROOT = ENV['HOME'] || File.expand_path('../../../', __FILE__) | |
PIDFILE = File.join(ROOT, 'shared/pids/server.pid') | |
def get_pid | |
# XXX: this should be more intelligent, and check if, | |
# a) the pid is still alive, | |
# b) pid is actually unicorn |
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
upstream APPNAME_unicorn_server { | |
server unix:/tmp/.APPNAME_sock_hodor; | |
} | |
server { | |
listen PORT; | |
server_name _; | |
keepalive_timeout 5; | |
root /home/APPNAME/current/public; |
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
# run rackup -s thin | |
# | |
require 'queue-stuffs' | |
map '/' do | |
run Herro | |
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 'rubygems' | |
require 'yaml' | |
require 'getoptlong' | |
gem 'soap4r' | |
require 'soap/soap' | |
require 'soap/rpc/driver' | |
require 'jira4r/jira_tool' | |
require 'jira4r/v2/jira_service' |
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 'rubygems' | |
require 'crack' | |
xmldoc = <<-doc | |
<root-node> | |
<child-node xsi:type = "mytypecast">data</child-node> | |
</root-node> | |
doc |
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 'rubygems' | |
require 'nokogiri' | |
doc = Nokogiri::XML open 'fbsdtest.xml' | |
os_type = doc.xpath('//os/type') | |
p os_type | |
puts os_type[0].attribute('arch') |