Skip to content

Instantly share code, notes, and snippets.

View thdaraujo's full-sized avatar
🏔️

Thiago Araujo thdaraujo

🏔️
View GitHub Profile
# 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
Common "no reply" emails, EXCEPT google docs notifications (which I actually want)
<apps:property name='hasTheWord' value='from:(noreply OR no-reply OR donotreply) -docs.google.com' />
Common app & service notifications
<apps:property name='hasTheWord' value='has joined your Personal Meeting Room' />
<apps:property name='from' value='no-reply@zoom.us' />
<apps:property name='from' value='venmo@venmo.com' />
<apps:property name='from' value='donotreply@godaddy.com' />
<apps:property name='from' value='no_reply@email.apple.com' />
<apps:property name='from' value='no-reply@dropbox.com' />
# Clean the database
DROP TABLE IF EXISTS _orders CASCADE;
DROP TABLE IF EXISTS _users CASCADE;
DROP TABLE IF EXISTS orders CASCADE;
DROP TABLE IF EXISTS users CASCADE;
# Build the database (for hard deletion)
CREATE TABLE users (
id integer PRIMARY KEY GENERATED ALWAYS AS IDENTITY,
name text NOT NULL
@etagwerker
etagwerker / rails-new.sh
Created October 8, 2022 19:20
rails-new.sh
rails new librarian -d postgresql --skip-system-test --skip-action-mailbox --skip-action-cable --skip-active-job --skip-active-storage --skip-jbuilder --asset-pipeline=propshaft --css=tailwind
--javascript=esbuild
@patmaddox
patmaddox / .cirrus.yml
Last active October 31, 2022 19:49
Cirrus CI build/test/deploy config for Elixir on FreeBSD using ex_freebsd
gcp_credentials: ENCRYPTED[!...!]
# custom-built instance with some packages pre-installed to save time
# otherwise use:
# freebsd_instance:
# image_family: freebsd-13-0
# and install your packages
gce_instance:
image_project: ratio-ops
image_family: ratio-freebsd-13-1-ci
@jjb
jjb / file.md
Last active April 14, 2026 22:58
Using Jemalloc 5 with Ruby.md

For years, people have been using jemalloc with ruby. There were various benchmarks and discussions. Legend had it that Jemalloc 5 didn't work as well as Jemalloc 3.

Then, one day, hope appeared on the horizon. @wjordan offered a config for Jemalloc 5.

Ubuntu/Debian

FROM ruby:3.1.2-bullseye
RUN apt-get update ; \
@kddnewton
kddnewton / bignums.rb
Created December 15, 2023 21:39
Bignums
# frozen_string_literal: true
class Number
SIZE = 32
attr_reader :values
def initialize(values = [0])
@values = values
end