Skip to content

Instantly share code, notes, and snippets.

@rurounijones
rurounijones / server.log
Created February 7, 2012 01:16
Torquebox debug log
10:11:43,425 DEBUG [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 2) Deployment scan of [C:\torquebox-current\jboss\standalone\deployments] found update action [{
"operation" => "composite",
"address" => undefined,
"steps" => [
{
"operation" => "add",
"address" => [("deployment" => "test01-knob.yml")],
"content" => [{
"path" => "deployments/test01-knob.yml",
"relative-to" => "jboss.server.base.dir",
@rurounijones
rurounijones / results
Created February 7, 2012 09:19
Ruby FFI shennanigans
$ rvm current
ruby-1.9.3-p0
$ ruby test.rb
Input: 'Test テスト 文字調査', UTF-8
Output: 'Test テスト 文字調査', ASCII-8BIT
$ rvm current
jruby-1.6.6
$ ruby --1.9 test.rb
Input: 'Test テスト 文字調査', UTF-8
@rurounijones
rurounijones / example.cpp
Created February 27, 2012 00:14
Datalogics C++ Example
/* Copyright 2007 Datalogics, Inc. All rights reserved.
This program tests the PDF2IMG C API functionality for reading PDFs
from blocks of memory and writing PDFs to blocks of memory. Posted got this Gist with permission
*/
#include "pdf2imglib.h"
#include <math.h>
#include <stdio.h>
@rurounijones
rurounijones / gist:2326019
Created April 7, 2012 06:51
Roomba Positioning
def initialize(port, latency=0, baud=115200)
# baud must be 115200 for communicating with 500 series Roomba and newer (tested with Roomba 770), change to 57600 for 400 series and older
@serial = SerialPort.new(port, baud, 8, 1, SerialPort::NONE)
@latency = latency
# We will assume these are the positions and directions of the Roomba when
# initially docked
@x = 0
@y = 0
@facing = 0
Started DELETE "/users/rurounijones" for 127.0.0.1 at 2012-05-03 05:44:43 +0900
Processing by UsersController#destroy as HTML
Parameters: {"authenticity_token"=>"FTFV0iNtTJSvhdp1I5q++p2SDQxgcbEkItXL242YCbI=", "id"=>"rurounijones"}
User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."nickname" = 'rurounijones' LIMIT 1
CACHE (0.0ms) SELECT "users".* FROM "users" WHERE "users"."nickname" = 'rurounijones' LIMIT 1
(0.1ms) BEGIN
(0.1ms) ROLLBACK
-----------------------------------------------
@rurounijones
rurounijones / gist:2698969
Created May 15, 2012 03:49
Torquebox Stacktrace
12:42:29,598 INFO [Castor] (http-localhost-127.0.0.1-8080-4) Processing by DsmSetsController#show as JPG
12:42:29,600 INFO [Castor] (http-localhost-127.0.0.1-8080-3) Processing by DsmSetsController#show as JPG
12:42:29,600 INFO [Castor] (http-localhost-127.0.0.1-8080-3) Parameters: {"set"=>{"text"=>"Testing23", "width"=>"800"}, "key"=>"bdSFBUxfa1EVAWCWWvBr", "id"=>"4ee58f848625ee2cc2000004"}
12:42:29,602 INFO [Castor] (http-localhost-127.0.0.1-8080-4) Parameters: {"set"=>{"text"=>"Testing23", "width"=>"800"}, "key"=>"bdSFBUxfa1EVAWCWWvBr", "id"=>"4ee58f848625ee2cc2000003"}
12:42:29,614 INFO [Castor] (http-localhost-127.0.0.1-8080-8) Processing by DsmSetsController#show as JPG
12:42:29,614 INFO [Castor] (http-localhost-127.0.0.1-8080-8) Parameters: {"set"=>{"text"=>"Testing23", "width"=>"800"}, "key"=>"bdSFBUxfa1EVAWCWWvBr", "id"=>"4ee58f848625ee2cc2000008"}
12:42:29,616 INFO [Castor] (http-localhost-127.0.0.1-8080-2) Processing by DsmSetsController#show as JPG
12:42:29,617 INFO [Castor] (http-lo
object @pdf_template => "pdf_template"
attributes :id, :code, :name, :pdf_engine, :created_at, :updated_at
child :pages doz
attributes :number, :layout
child :dimension do
attributes :code, :width, :height
end
child :areas => :areas do
# -*- encoding : utf-8 -*-
# This file is copied to spec/ when you run 'rails generate rspec:install'
# Simplecov is disabled until this issue has been fixed
# https://github.com/colszowka/simplecov/issues/86
#require 'simplecov'
#SimpleCov.start 'rails' do
# add_filter "/app/views"
# add_group "Jobs", "app/jobs"
# add_group "Services", "app/services"
@rurounijones
rurounijones / Equivalent Rails Log entry
Created September 11, 2012 00:13
Logstash Formatted JSON log entry from Rails
Started GET "/account/register" for 127.0.0.1 at 2012-09-11 09:10:20 +0900
Processing by AccountController#register as HTML
(0.1ms) SELECT MAX("settings"."updated_on") AS max_id FROM "settings"
AnonymousUser Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."type" IN ('AnonymousUser') LIMIT 1
Setting Load (0.1ms) SELECT "settings".* FROM "settings" WHERE "settings"."name" = 'default_language' LIMIT 1
Setting Load (0.1ms) SELECT "settings".* FROM "settings" WHERE "settings"."name" = 'password_min_length' LIMIT 1
CustomField Load (0.1ms) SELECT "custom_fields".* FROM "custom_fields" WHERE (type = 'UserCustomField') ORDER BY position
Rendered account/register.html.erb within layouts/base (50.7ms)
UserPreference Load (0.1ms) SELECT "user_preferences".* FROM "user_preferences" WHERE "user_preferences"."user_id" = 2 LIMIT 1
Completed 200 OK in 62ms (Views: 58.7ms | ActiveRecord: 0.9ms)
@rurounijones
rurounijones / DsmSet.rb
Created September 12, 2012 06:55
Torquebox 2.1.0 error
class DsmSet
include Mongoid::Document
def to_jpg(opts = nil, user = nil, api = nil)
opts ||= {}
opts[:text] ||= 'Gemini'
opts[:width] ||= 210
opts[:compression] ||= 8
opts[:watermark] ||= false