time rspec spec
7.26s user 2.04s system 82% cpu 11.265 total
time rails runner "puts 3"
3.91s user 1.34s system 89% cpu 5.852 total
require 'i18n' | |
if (Rails.env.development? || Rails.env.test?) && ENV['SHOW_TR'] | |
module I18n | |
class << self | |
def translate_with_debug(*args) | |
result = translate_without_debug(*args) | |
puts "[\e[32mTranslate\e[0m] #{args.inspect}\t [\e[31mResult\e[0m] #{result}" | |
end | |
alias_method_chain :translate, :debug |
Как ломались огни чей-то жизни навзрыд, | |
как купались ангелы вдоль стиксовых вод. | |
Как упилися мы у родных нам могил, | |
Как кружились собаки да в ночь хоровод. |
#!/bin/bash | |
# Checks the files to be committed for the presence of binding.pry | |
# The array below can be extended for further checks | |
checks[1]="binding.pry" | |
checks[2]="console.log" | |
element_count=${#checks[@]} | |
let "element_count = $element_count + 1" |
./configure --prefix=/etc/nginx --sbin-path=/usr/local/sbin --pid-path=/var/lock/nginx/nginx.pid --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --conf-path=/etc/nginx/nginx.conf --with-http_ssl_module --with-http_gzip_static_module |
#!/usr/bin/env ruby | |
require 'rubygems' | |
gempaths = Gem::default_path | |
puts | |
puts "Scanning paths in Gem::default_path for RubyGems with native extensions ..." | |
puts |
# A small DSL for helping parsing documents using Nokogiri::XML::Reader. The | |
# XML Reader is a good way to move a cursor through a (large) XML document fast, | |
# but is not as cumbersome as writing a full SAX document handler. Read about | |
# it here: http://nokogiri.org/Nokogiri/XML/Reader.html | |
# | |
# Just pass the reader in this parser and specificy the nodes that you are interested | |
# in in a block. You can just parse every node or only look inside certain nodes. | |
# | |
# A small example: | |
# |
### Nginx upstart script | |
### source: http://serverfault.com/a/391737/70451 | |
### /etc/init/nginx.conf | |
description "nginx http daemon" | |
start on (filesystem and net-device-up IFACE=lo) | |
stop on runlevel [!2345] | |
env DAEMON=/usr/local/sbin/nginx |