Skip to content

Instantly share code, notes, and snippets.

View kitplummer's full-sized avatar
🏠
Working from home

Kit Plummer kitplummer

🏠
Working from home
View GitHub Profile
require 'pdftohtmlr'
require 'nokogiri'
include PDFToHTMLR
file = PdfFilePath.new("test.pdf", # source pdf file path
nil, # target html file path - not implemented
nil, # user password
nil # owner password
)
#!/usr/bin/ruby
# For accessing Go!Temp probe from Ruby on Linux
f = File.new("/dev/ldusb0")
packet = f.read(8)
parsed_packet = packet.unpack('ccsss')
puts "temp: #{(parsed_packet[2]/128).to_s}"
require 'rubygems'
require 'pachuber'
require 'eeml'
f = File.new("/dev/ldusb0")
packet = f.read(8)
parsed_packet = packet.unpack('ccsss')
temp = parsed_packet[2]/128
pachube_api_key = ''
@kitplummer
kitplummer / meph.rb
Created January 11, 2010 15:04
simple script used to consume mephisto blog entries into textile files.
#!/usr/bin/ruby -w
require "rubygems"
require "mysql"
begin
# connect to the MySQL server
dbh = Mysql.real_connect("url", "user", "pass", "db")
# get server version string and display it
puts "Server version: " + dbh.get_server_info
res = dbh.query("select id, title, body, published_at from contents")
class JobRoute {
def configure = {
println "Setting JobRoute Camel Router..."
from("seda:job.contents").
process{ exchange ->
String body = exchange.getIn().getBody()
def job = new XmlParser().parseText(body)
content:SUBJECT: CHECKMATE Army and Marine Corps Info Sharing and Reporting Initiative1. BACKGROUND: CHECKMATE originated as a collaborative effort of CAC-CDID?s IED-D ICDT Battle Command lead and the BCBL(L), CIO/G-6-funded Service Oriented Architecture (SOA) pilot to prototype the development of simplified and structured data entry and management. A CHECKMATE presentation in Jan 09 to the JCOE (NTC) resulted in USMC co-sponsorship for a JIEDDO funding submission, which includes a 12 month product development, followed 6 months later by a USA BCT / USMC MEB training center assessment, and finally, an operational assessment in Afghanistan. 2. DESCRIPTION: CHECKMATE?s integrated C2 infrastructure potentially ties the tactical edge to C-IED national capabilities (e.g., COIC) through the Global Information Grid (GIG), and moves time-sensitive indications, warnings, and alerts to Soldiers and Marines. CHECKMATE will operate over existing low-bandwidth communications, will integrate into existing Army Battle Comma
import org.codehaus.groovy.grails.web.servlet.GrailsApplicationAttributes
import org.codehaus.groovy.grails.web.servlet.mvc.GrailsWebRequest
import org.springframework.mock.web.MockHttpServletResponse
import org.springframework.mock.web.MockServletContext
import org.springframework.mock.web.MockMultipartHttpServletRequest
import org.springframework.web.context.request.RequestContextHolder
import grails.test.*
class JobControllerTests extends GroovyTestCase {
<xmi:XMI xmlns:xmi="http://www.omg.org/XMI" xmi:version="2.0">
<cas:NULL xmlns:cas="http:///uima/cas.ecore" xmi:id="0"/>
<cas:Sofa xmlns:cas="http:///uima/cas.ecore" xmi:id="1" sofaNum="1" sofaID="_InitialView" mimeType="text" sofaString="SUBJECT: CHECKMATE Army and Marine Corps Info Sharing and Reporting Initiative
1. BACKGROUND: CHECKMATE originated as a collaborative effort of CAC-CDIDís IED-D ICDT Battle Command lead and the BCBL(L), CIO/G-6-funded Service Oriented Architecture (SOA) pilot to prototype the development of simplified and structured data entry and management. A CHECKMATE presentation in Jan 09 to the JCOE (NTC) resulted in USMC co-sponsorship for a JIEDDO funding submission, which includes a 12 month product development, followed 6 months later by a USA BCT / USMC MEB training center assessment, and finally, an operational assessment in Afghanistan.
2. DESCRIPTION: CHECKMATEís integrated C2 infrastructure potentially ties the tactical edge to C-IED national capabilities (e.g.,
<xmi:XMI xmlns:xmi="http://www.omg.org/XMI" xmi:version="2.0">
<cas:NULL xmlns:cas="http:///uima/cas.ecore" xmi:id="0"/>
<cas:Sofa xmlns:cas="http:///uima/cas.ecore" xmi:id="1" sofaNum="1" sofaID="_InitialView" mimeType="text" sofaString="¬?¬?¬?¬?¬?¬?¬?¬?¬?¬?¬?¬?¬? 5 August 2009
SUBJECT:¬? CHECKMATE Army and Marine Corps Info Sharing and Reporting Initiative
1.¬? BACKGROUND: CHECKMATE originated as a collaborative effort of CAC-CDID?Äôs IED-D ICDT Battle Command lead and the BCBL(L), CIO/G-6-funded Service Oriented Architecture (SOA) pilot to prototype the development of simplified and structured data entry and management. A CHECKMATE presentation in Jan 09 to the JCOE (NTC) resulted in USMC co-sponsorship for a JIEDDO funding submission, which includes a 12 month product development, followed 6 months later by a USA BCT / USMC MEB training center assessment, and finally, an operational assessment in Afghanistan.¬?
¬?
^Crake aborted!
tried to create Proc object without a block
/Users/kplummer/.rvm/gems/ruby-1.8.7-p249/gems/sinatra-1.0/lib/sinatra/base.rb:859:in `define_method'
/Users/kplummer/.rvm/gems/ruby-1.8.7-p249/gems/sinatra-1.0/lib/sinatra/base.rb:859:in `route'
/Users/kplummer/.rvm/gems/ruby-1.8.7-p249/gems/sinatra-1.0/lib/sinatra/base.rb:838:in `get'
(__DELEGATE__):2:in `send'
(__DELEGATE__):2:in `get'
/Users/kplummer/.rvm/gems/ruby-1.8.7-p249/gems/redis-namespace-0.4.1/lib/redis/namespace.rb:166:in `send'
/Users/kplummer/.rvm/gems/ruby-1.8.7-p249/gems/redis-namespace-0.4.1/lib/redis/namespace.rb:166:in `method_missing'
/Users/kplummer/.rvm/gems/ruby-1.8.7-p249/gems/resque-1.8.0/lib/resque/worker.rb:406:in `processing'