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
<?php | |
/* This file is used by the Zabbix PHP web frontend. | |
* It is pre-filled with the information asked during | |
* installation of the zabbix-server-* package. | |
*/ | |
global $DB; | |
$DB["TYPE"] = "pgsql"; |
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
ping ya.ru | |
PING ya.ru (87.250.250.3): 56 data bytes | |
Request timeout for icmp_seq 0 | |
Request timeout for icmp_seq 1 | |
64 bytes from 87.250.250.3: icmp_seq=0 ttl=54 time=2497.125 ms | |
64 bytes from 87.250.250.3: icmp_seq=0 ttl=55 time=2497.153 ms (DUP!) | |
64 bytes from 87.250.250.3: icmp_seq=0 ttl=54 time=2497.483 ms (DUP!) | |
64 bytes from 87.250.250.3: icmp_seq=0 ttl=55 time=2497.488 ms (DUP!) | |
64 bytes from 87.250.250.3: icmp_seq=1 ttl=54 time=2136.664 ms | |
Request timeout for icmp_seq 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
#!/usr/bin/env ruby | |
#Dir.chdir File.join(__FILE__, "../..") | |
require 'openssl' | |
unless ENV['EDITOR'] | |
puts "No EDITOR found. Try:" | |
puts "export EDITOR=vim" | |
exit 1 | |
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
require 'rubygems' | |
require 'pg' | |
require 'yaml' | |
class DB | |
def initialize(debug = true) | |
@conn = PG::Connection.open() | |
@debug = debug | |
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
Ruby | |
принципиальное различие скриптовых и “обычных” языков | |
3 принципа ООП | |
реализация множественного наследования в ruby | |
duck typing | |
многопоточность в ruby | |
Rails | |
что такое MVC и зачем это нужно | |
локига в контроллере, должна ли быть и почему | |
синхронные и асинхронные операции — предложить варианты решения |
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
$ cd .rvm/src/ree-1.8.7-2011.03/source/ext/readline/ | |
~/.rvm/src/ree-1.8.7-2011.03/source/ext/readline$ ls | |
~/.rvm/src/ree-1.8.7-2011.03/source/ext/readline$ brew install readline | |
Warning: Formula already installed: readline | |
~/.rvm/src/ree-1.8.7-2011.03/source/ext/readline$ ruby extconf.rb --with-readline-dir=/usr/local/Cellar/readline/6.2.1/ | |
checking for tgetnum() in -lncurses... yes | |
[...skiped...] | |
creating Makefile | |
~/.rvm/src/ree-1.8.7-2011.03/source/ext/readline$ make | |
cc -dynamic -bundle -undefined suppress -flat_namespace -o readline.bundle readline.o -L. -L/Users/brun/.rvm/rubies/ree-1.8.7-2011.03/lib -L/usr/local/Cellar/readline/6.2.1//lib -L. -lreadline -lncurses -L/opt/local/lib -ldl -lobjc |
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 'rubygems' | |
# Rails on-screen logging | |
def change_log(stream) | |
ActiveRecord::Base.logger = Logger.new(stream) | |
ActiveRecord::Base.clear_active_connections! | |
end | |
def show_log |
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
SQL (0.1ms) SET client_min_messages TO 'panic' | |
SQL (0.1ms) SET standard_conforming_strings = on | |
SQL (0.1ms) SET client_min_messages TO 'notice' | |
SQL (0.3ms) SELECT count(*) AS count_all FROM "messages" | |
SQL (0.1ms) BEGIN | |
SQL (0.3ms) INSERT INTO "messages" ("created_at", "author", "updated_at", "text") VALUES('2010-12-08 20:37:39.876065', 'test', '2010-12-08 20:37:39.876065', 'test') RETURNING "id" | |
SQL (0.2ms) INSERT INTO "messages" ("created_at", "author", "updated_at", "text") VALUES('2010-12-08 20:37:39.879843', 'test', '2010-12-08 20:37:39.879843', 'test') RETURNING "id" | |
SQL (22.8ms) COMMIT | |
SQL (0.2ms) SELECT count(*) AS count_all FROM "messages" |
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 'config/environment' | |
puts Message.count | |
Message.transaction do | |
Message.create! :author => 'test', :text => 'test' | |
Message.transaction(:requires_new => true) do | |
Message.create! :author => 'test', :text => 'test' |
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
# File 1.rb, use rails 2.3.10 | |
require 'config/environment' | |
puts Message.count | |
Message.transaction do | |
Message.create! :author => 'test', :text => 'test' | |
Message.transaction do |
NewerOlder