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 | |
set -u | |
set -e | |
# Example init script, this can be used with nginx, too, | |
# since nginx and unicorn accept the same signals | |
# Feel free to change any of the following variables for your app: | |
APP_ROOT=/home/deploy/public_html/rm/current | |
PID=$APP_ROOT/tmp/pids/unicorn.pid | |
ENV=production |
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
From 9bed12e78880a4ddce90ca4a846090773bc8538d Mon Sep 17 00:00:00 2001 | |
From: Dmitrii Samoilov <[email protected]> | |
Date: Tue, 20 Jul 2010 11:10:51 +0300 | |
Subject: [PATCH] fix for the bug in plugins.rb (const_defined?(:ClassMethods) for whatever reason doesn't work for rails3b4 and ruby1.9.2-rc2) | |
--- | |
lib/mongo_mapper/plugins.rb | 4 +++- | |
1 files changed, 3 insertions(+), 1 deletions(-) | |
diff --git a/lib/mongo_mapper/plugins.rb b/lib/mongo_mapper/plugins.rb |
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
$ ruby -v | |
ruby 1.8.7 (2010-06-23 patchlevel 299) [i686-linux] | |
$irb | |
ruby-1.8.7-p299 > a = (125.33 - (125.33/100.0*50.0)) | |
=> 62.665 | |
ruby-1.8.7-p299 > b = 62.665 | |
=> 62.665 | |
ruby-1.8.7-p299 > (a*100).round | |
=> 6266 |
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
1.9.3dev | |
$ ruby -v | |
ruby 1.9.3dev (2010-12-08 trunk 30125) [i686-linux] | |
$ irb | |
ruby-head > 125.33 - (125.33/100.0*50.0) | |
=> 62.66499999999999 | |
ruby-head > 125.33 / 100.0 * 50.0 | |
=> 62.665000000000006 |
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
$ redis-benchmark | |
====== PING (inline) ====== | |
10000 requests completed in 0.43 seconds | |
50 parallel clients | |
3 bytes payload | |
keep alive: 1 | |
19.85% <= 1 milliseconds | |
97.70% <= 2 milliseconds |
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
# run with: god -c /path/to/config.god [add -D if you want to not-deamonize god] | |
# This is the actual config file used to keep the delayed_job running | |
APPLICATION_ROOT = "/var/www/application" | |
RAILS_ENV = "production" | |
God.watch do |w| | |
w.name = "delayed_job_production" | |
w.interval = 15.seconds | |
w.start = "/bin/bash -c 'cd #{APPLICATION_ROOT}/current; /usr/bin/env RAILS_ENV=#{RAILS_ENV} #{APPLICATION_ROOT}/current/script/delayed_job start > /tmp/delay_job.out'" |
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
- Неужели и здесь то же самое? - задал я горький и не вполне понятный вопрос. | |
- И здесь, и везде, - сказал Иегова. - И всегда. Проследи за тем, что происходит во время человеческого общения. | |
Зачем человек открывает рот? | |
Я пожал плечами. | |
- Главная мысль, которую человек пытается донести до других, заключается в том, что он имеет доступ к гораздо более | |
престижному потреблению, чем про него могли подумать. Одновременно с этим он старается объяснить окружающим, что | |
их тип потребления гораздо менее престижен, чем они имели наивность думать. Этому подчинены все социальные маневры. | |
Больше того, только эти вопросы вызывают у людей стойкие эмоции. | |
- Вообще-то мне в жизни попадались и другие люди, - сказал я с легкой иронией. | |
Иегова кротко посмотрел на меня. |
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
module ActiveRecord | |
Base.singleton_methods.each do |m| | |
Base.class_eval <<-EOS | |
class << self | |
puts "redefining #{m}" | |
define_method "#{m}_with_introspection" do |*args| | |
puts "#{m}" | |
send(:"#{m}_without_introspection", *args) | |
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
Loading development environment (Rails 2.3.5) | |
>> module ActiveRecord | |
>> Base.singleton_methods.each do |m| | |
?> Base.class_eval <<-EOS | |
class << self | |
puts "redefining #{m}" | |
define_method "#{m}_with_introspection" do |*args| | |
puts "#{m}" | |
send(:"#{m}_without_introspection", *args) |
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
#include “mruby.h” | |
#include “mruby/proc.h” | |
#include <stdio.h> | |
void _error(const char* s){ | |
printf("ERROR: %s\n", s); | |
exit(1); | |
} | |
int main() { |
OlderNewer