Skip to content

Instantly share code, notes, and snippets.

def self.daemon
IO.popen("python /root/isk-daemon-0.6.2/isk-daemon.py 2>&1") { |io|
i = ""
thread = Thread.new {
while IO.select([io], nil, nil) do
i = io.gets
puts i
break if i.nil?
end
}
def x_put (blob)
self.permalink = UUID.random_create.to_s if self.permalink.blank?
imgs = Magick::Image.from_blob(blob)
first = imgs.first
case first.get_exif_by_entry("Orientation") && first["EXIF:Orientation"]
when "6"
first.rotate!(90)
first["EXIF:Orientation"] = "1"
when "3"
first.rotate!(180)
# Typical way of handling the email in the controller
class UsersController < ApplicationController
def create
@user = User.new params[:user]
UserMailer.deliver_welcome(@user) if @user.save
end
end
=CRASH REPORT==== 12-Nov-2009::17:24:16 ===
crasher:
initial call: gen:init_it/6
pid: <0.22220.97>
registered_name: []
exception exit: system_limit
in function gen_server2:terminate/6
ancestors: [<0.22138.97>]
messages: [{'EXIT',<0.22137.97>,normal}]
links: []
=CRASH REPORT==== 31-Jan-2010::06:30:43 ===
crasher:
initial call: gen:init_it/6
pid: <0.6619.974>
registered_name: []
exception exit: {{case_clause,{error,system_limit}},
[{rabbit_queue_index,scatter_journal,4},
{rabbit_queue_index,init,1},
{rabbit_variable_queue,init,1},
{rabbit_amqqueue_process,init,1},
=CRASH REPORT==== 31-Jan-2010::06:49:55 ===
crasher:
initial call: ssl_connection:init/1
pid: <0.11745.973>
registered_name: []
exception exit: bad_info
in function gen_fsm:terminate/7
ancestors: [ssl_connection_sup,ssl_sup,<0.180.0>]
messages: []
links: [<0.188.0>]
# GravitronShiftr
#
# just a simple test of ShinyCocos2d
# i could get used to this
class DemoScene < Cocos2D::Scene
include Cocos2D
def initialize
@layer = Layer.new
# GravitronShiftr
#
# just a simple test of ShinyCocos2d
class DemoScene < Cocos2D::Scene
include Cocos2D
def initialize
@layer = Layer.new
@map = TMXTiledMap.new("sewers.tmx")
core file size (blocks, -c) unlimited
data seg size (kbytes, -d) unlimited
file size (blocks, -f) unlimited
max locked memory (kbytes, -l) unlimited
max memory size (kbytes, -m) unlimited
open files (-n) unlimited
pipe size (512 bytes, -p) 1
stack size (kbytes, -s) 65532
cpu time (seconds, -t) unlimited
max user processes (-u) 532
Processing InternalController#revision (for localhost at 2010-04-27 16:27:26) [GET]
Parameters: {"wang"=>"wang"}
Completed in 12ms (View: 1, DB: 2) | 200 OK [http://localhost/internal/revision?wang=%22wang%22]