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
Apartment.configure do |config| | |
config.excluded_models = ['Company'] | |
config.persistent_schemas = ['hstore'] | |
config.database_names = lambda{ Company.select(:name).map(&:name) } | |
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
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 |
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
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) |
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
# -*- 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" |
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
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 |
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
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 |
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
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 | |
----------------------------------------------- |
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
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 |
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
/* 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> |
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
$ 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 |