⌘T | go to file |
⌘⌃P | go to project |
⌘R | go to methods |
⌃G | go to line |
⌘KB | toggle side bar |
⌘⇧P | command prompt |
# This has very little win: | |
<%= content_tag(:p, "Foo", "data-bah" => "...", "data-baz" => "...") %> | |
# Some chumps make it even more noisy: | |
<%= content_tag(:p, "Foo", :"data-bah" => "...", :"data-baz" => "...") %> | |
# I was going to patch Rails to convert :data_bah to "data-bah" | |
<%= content_tag(:p, "Foo", :data_bah => "...", :data_baz => "...") %> | |
# But they already do this: |
# autoload concerns | |
module YourApp | |
class Application < Rails::Application | |
config.autoload_paths += %W( | |
#{config.root}/app/controllers/concerns | |
#{config.root}/app/models/concerns | |
) | |
end | |
end |
# Ruby 1.9 Fast require: | |
# https://gist.github.com/1008945 | |
curl https://raw.github.com/gist/1008945/7532898172cd9f03b4c0d0db145bc2440dcbb2f6/load.patch > load.patch | |
# Ruby 1.9.2 GC Patch: | |
# https://gist.github.com/856296 | |
curl https://raw.github.com/gist/856296/a19ac26fe7412ef398bd9f57e61f06fef1f186fe/patch-1.9.2-gc.patch > gc.patch | |
rvm install 1.9.2-p180 --patch load.patch,gc.patch -n loadgc | |
rm gc.patch load.patch |
[ | |
{ "keys": ["ctrl+shift+x"], "command": "tidy_xml" }, | |
{ "keys": ["ctrl+shift+j"], "command": "prettify_json" } | |
] |
### | |
# Read in XML as a stream, write out JSON as a stream. As little information | |
# is kept in memory as possible. | |
require 'nokogiri' | |
require 'psych' | |
class JSONTranslator < Nokogiri::XML::SAX::Document | |
attr_reader :emitter | |
def initialize emitter |
- This creates a 560mb ramdisk. Adjust the size accordingly. I think the number at the end of the command is the number of disk blocks. They are 2kb in size for me.
- Restarting postgres is not necessary; you can create the ramdisk and tablespace while postgres is running.
- You will lose all data in the ramdisk tablespace when you shut your machine down
$ diskutil erasevolume HFS+ "postgres_ramdisk" `hdiutil attach -nomount ram://1165430`
Started erase on disk1
Unmounting disk
Erasing
Initialized /dev/rdisk1 as a 569 MB HFS Plus volume
# Rspec formatter by RAFAELDX7 | |
# Use: rspec --require "dx7_formatter.rb" --format Dx7Formatter -- ./spec/your_spec.rb | |
require 'rspec/core/formatters/base_text_formatter' | |
class Dx7Formatter < RSpec::Core::Formatters::BaseTextFormatter | |
def index | |
@index ||= -1 | |
@index += 1 |
This installs a patched ruby 1.9.3-p327 with various performance improvements and a backported COW-friendly GC, all courtesy of funny-falcon.
You will also need a C Compiler. If you're on Linux, you probably already have one or know how to install one. On OS X, you should install XCode, and brew install autoconf
using homebrew.
Recentemente eu comentei sobre a migração que fizemos no [Myfinance][mf] saindo do [Heroku][h] e indo para a [Amazon Web Services][a] e diversas pessoas me perguntaram as razões pela qual fizemos essa mudança. O objetivo desse post é apenas explicar a decisão que a nossa equipe tomou, como foi e as conseguências dessa migração.
Antes de começar eu gostaria de deixar claro que o objetivo desse texto não é comparar hospedagens e nem dizer que uma é melhor do que a outra. Trata-se apenas do relato de uma experiência.
Antes de explicar a motivação por trás da migração é interessante mostrar como era a nossa estrutura.