This file contains 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
Synvert::Rewriter.new "remote_rewriter", "Remote rewriter example" do | |
end |
This file contains 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 Image | |
extend ActiveModel::Naming | |
extend ActiveModel::Callbacks | |
include ActiveModel::Validations | |
include Paperclip::Glue | |
define_model_callbacks :save, only: [:after] | |
define_model_callbacks :destroy, only: [:before, :after] |
This file contains 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
#! /bin/sh | |
### BEGIN INIT INFO | |
# Provides: god | |
# Required-Start: $remote_fs $syslog | |
# Required-Stop: $remote_fs $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: God initscript | |
### END INIT INFO |
This file contains 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
# {"text":"富裕"} | |
Server Software: Goliath | |
Server Hostname: 127.0.0.1 | |
Server Port: 9000 | |
Document Path: /v1/dicts/homonyms | |
Document Length: 23 bytes | |
Concurrency Level: 10 |
This file contains 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
"http--127.0.0.1-8180-1" daemon prio=10 tid=0x00007f4a178e8800 nid=0x7265 in Object.wait() [0x0000000049bfb000] | |
java.lang.Thread.State: TIMED_WAITING (on object monitor) | |
at java.lang.Object.wait(Native Method) | |
- waiting on <0x0000000704f40e18> (a org.jruby.libraries.ThreadLibrary$ConditionVariable) | |
at java.lang.Object.wait(Object.java:443) | |
at org.jruby.RubyThread$SleepTask.run(RubyThread.java:816) | |
- locked <0x0000000704f40e18> (a org.jruby.libraries.ThreadLibrary$ConditionVariable) | |
at org.jruby.RubyThread.executeBlockingTask(RubyThread.java:832) | |
at org.jruby.RubyThread.wait_timeout(RubyThread.java:1097) | |
at org.jruby.libraries.ThreadLibrary$ConditionVariable.wait_ruby(ThreadLibrary.java:286) |
This file contains 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
GC::Profiler.enable | |
before_stats = ObjectSpace.count_objects | |
start = Time.now | |
files = Dir["**/*"].map { |file| file unless File.directory?(file) } | |
`zip test.zip #{files.join(" ")}` | |
puts "Total time: #{Time.now - start}" | |
after_stats = ObjectSpace.count_objects | |
puts "[GC Stats] #{before_stats[:FREE] - after_stats[:FREE]} new allocated objects." | |
# Total time: 0.349816 |
This file contains 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 'zip/zip' | |
GC::Profiler.enable | |
before_stats = ObjectSpace.count_objects | |
start = Time.now | |
Zip::ZipFile.open("test.zip", Zip::ZipFile::CREATE) do |z| | |
Dir["**/*"].each do |file| | |
z.add file, file | |
end | |
end | |
puts "Total time: #{Time.now - start}" |
This file contains 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
➜ torquebox-lite git:(master) mvn install | |
[INFO] Scanning for projects... | |
[INFO] ------------------------------------------------------------------------ | |
[INFO] Reactor Build Order: | |
[INFO] | |
[INFO] TorqueBox Lite | |
[INFO] TorqueBox Lite Build Aggregator | |
[INFO] TorqueBox Lite Build Assembly | |
[INFO] TorqueBox Lite Gems Parent | |
[INFO] TorqueBox Lite Gem |
This file contains 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 trinidad { | |
$jruby_home = "/opt/jruby" | |
$trinidad_home = "/opt/trinidad" | |
package { jsvc : | |
ensure => present | |
} | |
exec { install_trinidad : | |
command => "jruby -S gem install trinidad -v 1.3.4", |
This file contains 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 'redis' | |
require 'benchmark' | |
# user system total real | |
# redis set 0.280000 0.170000 0.450000 ( 0.809112) | |
# redis get 0.290000 0.160000 0.450000 ( 0.806711) | |
# redis mset with 1000 0.070000 0.020000 0.090000 ( 0.148474) | |
# redis mget with 1000 0.080000 0.020000 0.100000 ( 0.142837) | |
# redis mset with 100 0.050000 0.000000 0.050000 ( 0.067859) | |
# redis mget with 100 0.050000 0.010000 0.060000 ( 0.063040) | |
# redis mset with 10 0.040000 0.000000 0.040000 ( 0.060200) |