Class names are CamelCase
.
Methods and variables are snake_case
.
Methods with a ?
suffix will return a boolean.
--- | |
version: '2' | |
services: | |
zookeeper: | |
image: confluentinc/cp-zookeeper:latest | |
environment: | |
ZOOKEEPER_CLIENT_PORT: 2181 | |
ZOOKEEPER_TICK_TIME: 2000 | |
kafka: |
class RenameReadColumToState < ActiveRecord::Migration | |
def change | |
add_column :messages, :state, :integer, default: 0 | |
execute "UPDATE messages SET state = CAST(read AS INTEGER);" | |
remove_column :messages, :read | |
end | |
end |
def save_and_open_page | |
dir = "#{Rails.root}/tmp/cache/capybara" | |
file = "#{dir}/#{Time.now.strftime('%Y-%m-%d-%H-%M-%S')}.png" | |
FileUtils.mkdir_p dir | |
page.driver.render file | |
wait_until { File.exists?(file) } | |
system "open #{file}" | |
end |
git branch -m old_branch new_branch # Rename branch locally | |
git push origin :old_branch # Delete the old branch | |
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote |