- hot-key
- hook on save
- watch
- Rack::Reloader
- guard/autotest/shotgun/etc
This file contains hidden or 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
Rails.application.config.database_configuration | |
Rails.application.load_generators | |
Rails.application.load_seed | |
Rails.application.paths['db/migrate'].to_a | |
Rails.application.railties.all | |
Rails::Engine.find(ENGINE_PATH) | |
Rails.env | |
Rails.env.development? | |
Rails::Generators::SessionMigrationGenerator.start [ ENV['MIGRATION'] || 'add_sessions_table' ] | |
Rails.root |
This file contains hidden or 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
def empty?(s) | |
return s.size == 0 | |
end | |
class B | |
def ==(s) | |
"not boolean" | |
end | |
end |
-[ ] one
-[ ] two
-[ ] three
This file contains hidden or 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 'open3' | |
Open3.popen2e("wget", "http://dumps.wikimedia.org/ruwiki/latest/ruwiki-latest-templatelinks.sql.gz", "-O wiki.sql.gz") do |i, oe, wait_thr| | |
oe.each do |line| | |
puts line[/\d+%/] | |
end | |
end |
I often use VCR gem.
And I always configure it to use rspec metadata to turn it on with just :vcr
symbol.
When I know that some module will always hit the external service,
I turn VCR on at the very top describe
.
describe "Something", :vcr do
it "should make coffee" do
end
Once I've got a task to make a lot of files stored on S3 private.
In my project I used carrierwave and fog.
All files were public by default.
In order not to make many requests to AWS, I've decided to change bucket policy instead of ACL of each file.
Processor: Intel Core i3
time ./m_ffmpeg.sh dinner.m4v
./m_ffmpeg.sh dinner.m4v 48,54s user 5,34s system 142% cpu 37,897 total
time ./m_thumbnailer.sh dinner.m4v ./m_thumbnailer.sh dinner.m4v 66,21s user 5,61s system 156% cpu 45,918 total
This file contains hidden or 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 'active_support/testing/time_helpers' | |
RSpec.configure do |config| | |
config.include ActiveSupport::Testing::TimeHelpers | |
config.after do | |
travel_back | |
Timecop.return | |
end |