- DHH keynote
- How Shopify scales Rails
- Maintainable Templates
- Building Extractable Libraries in Rails
- Michael Lopp keynote
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 'date' | |
require 'minitest/autorun' | |
class SchoolYear | |
def self.date_range(day=Date.today.to_s) | |
d = Date.parse(day) | |
if d.month >= 8 | |
start_year = d.year | |
end_year = d.year + 1 | |
else |
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
if Rails.env.development? | |
require 'faker' | |
namespace :obfuscate do | |
desc "Obfuscate user data" | |
task :users => :environment do | |
raise "Not to be run in production!" if Rails.env.production? | |
User.all.each do |user| | |
unless user.admin? | |
user.update_attributes( |
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 'spec_helper' | |
describe 'path/to/view.html.erb' do | |
it "renders JavaScript to connect to a pretend API" do | |
render | |
expect(rendered).to match("api_key: '#{ENV['API_KEY']}',") | |
expect(rendered).to match("api_endpoint: '#{ENV['API_KEY']}',") | |
end | |
end |
(Alex Gaynor, Python Software Foundation)
- reviewing diffs vs. entire body of code: The latter takes the "why" out of the process
- "raise the bus factor"
- ensure readability: counterbalances self-optimization we do when we write code
- catch bugs: least important purpose of code reviews
- encourage healthy engineering culture: mechanism for giving and getting regular feedback
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
# Prerequisites: | |
# | |
# * Add pronto, pronto-rubocop, and any other pronto runners to Gemfile's | |
# development group (TODO: how to run using standalone gems?) | |
# Add dotenv to project's Gemfile, if necessary (dotenv-rails includes | |
# it by default) | |
# * Create a GitHub API token: https://github.com/settings/tokens. | |
# Give it the following scopes: repo, repo:status | |
# See this tutorial for more info: | |
# https://christoph.luppri.ch/articles/2017/03/05/how-to-automatically-review-your-prs-for-style-violations-with-pronto-and-rubocop/ |
https://github.com/RichiH/vcsh
vcsh init <repo>
vcsh <repo> add <files>
vcsh <repo> commit -m "<message>"
vcsh <repo> remote add origin <remote>
vcsh <repo> push -u origin master
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
# Don't print a new line at the start of the prompt | |
add_newline = false | |
# Disables the line_break module, making the prompt a single line. | |
[line_break] | |
disabled = true | |
# Replace the "❯" symbol in the prompt | |
[character] | |
symbol = "$" |
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
# [Choice] Ruby version: 2, 2.7, 2.6, 2.5 | |
ARG VARIANT=2 | |
FROM mcr.microsoft.com/vscode/devcontainers/ruby:0-${VARIANT} | |
ARG NODE_VERSION="lts/*" | |
RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1" | |
# [Optional] Uncomment this section to install additional OS packages. | |
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ | |
# && apt-get -y install --no-install-recommends <your-package-list-here> |