- banking and crypto pains
- going indy
- new jobs
- salary bands & hiring negotiations
- market hiring data & finding market data
- Atlanta rb and Tech404
- Old Philly user group history: philly lambda, algorithmics, ibm
- Listening and repeating tech stuff - fake it till you make it
- SinCity Ruby - Vegas, _why talks
- updated version of the rubykaigi 2021 talk https://rubykaigi.org/2021-takeout/presentations/schwad4hd14.html
This file contains 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
# I have lots of projects. As I do the rails upgrades I collect the pin changes and other adjustments here | |
# towards the end of upgrading all the projects it gets easier and easier because of these commands. | |
❯ ./rails-upgrade | |
Commands: | |
rails-upgrade apple_touch # add blank apple-touch icons | |
rails-upgrade application_record # adds ApplicationRecord and replaces all references to ActiveRecord::Base with it | |
rails-upgrade asset_precompile_check # look for assets that need to be added to the assets initializer precompile list | |
rails-upgrade assigns_check # the assigns method has been extracted to a gem, check if it is used, and add the gem | |
rails-upgrade before_filter # change before_filter to before_action in controllers |
# app/controllers/secret_messages_controller.rb
class SecretMessagesController < ApplicationController
def create
@secret_message_form = SecretMessageForm.new(secret_message_form_params)
if @secret_message_form.valid?
encrypted_content = encrypt_content(
seed_phrase: params[:secret_message_form][:seed_phrase],
password: params[:secret_message_form][:password],
This file contains 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
const minute = 60; | |
const hour = minute * 60; | |
const day = hour * 24; | |
const week = day * 7; | |
const month = day * 30; | |
const year = day * 365; | |
/** | |
* Convert a date to a relative time string, such as | |
* "a minute ago", "in 2 hours", "yesterday", "3 months ago", etc. |
Help Ukraine by attacking Russian web sites. Good load testing training.
Tools:
This file contains 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
words = [] | |
letters = ("a".."z").to_a | |
File.foreach("/usr/share/dict/words", chomp: true) do |word| | |
words << word.downcase if word.match?(/\A[a-z]{5}\z/i) | |
end | |
while words.length > 1 | |
weights = letters.to_h { |letter| [letter, 0] } | |
words.each do |word| |
This file contains 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 production setup via SQLite3 made durable by https://litestream.io/ | |
# Copy this to Dockerfile on a fresh rails app. Deploy to fly.io or any other container engine. | |
# | |
# try locally: docker build . -t rails && docker run -p3000:3000 -it rails | |
# | |
# in production you might want to map /data to somewhere on the host, | |
# but you don't have to! | |
# | |
FROM ruby:3.0.2 |
- Rails 7.0.1 is compatible with Ruby 3.1.0.
- Rails 7.0.1 addes net-smtp, net-imap and net-pop gems as Action Mailbox and Action Mailer dependency, you do not need to add them explicitly in your application Gemfile anymore.
- thor 1.2.1 has been released. You will not see
DidYouMean::SPELL_CHECKERS.merge
deprecate warnings anymore.
- Use Rails 6.1.5 to support
database.yml
with aliases andsecrets.yml
with aliases.
This file contains 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
#!/usr/bin/env ruby | |
require "fileutils" | |
# path to your application root. | |
APP_ROOT = File.expand_path("..", __dir__) | |
def system!(*args) | |
system(*args) || abort("\n== Command #{args} failed ==") | |
end |