Skip to content

Instantly share code, notes, and snippets.

View thdaraujo's full-sized avatar
🧡
coding

Thiago Araujo thdaraujo

🧡
coding
View GitHub Profile
@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
@jjb
jjb / file.md
Last active May 9, 2024 06:26
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 ; \
@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
@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
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' />
# 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
@dceddia
dceddia / ck-hide-unsubs.js
Last active February 14, 2022 19:27
Hide unsubscribers in ConvertKit (or replace them with a "% Stayed" instead)
// ==UserScript==
// @name CK - Hide or replace unsubs
// @namespace Violentmonkey Scripts
// @match https://app.convertkit.com/*
// @grant none
// @version 1.0
// @author -
// @description Hides the Unsubscribers number on broadcasts, or replaces it with the percentage of people who stayed.
// ==/UserScript==
@AlexB52
AlexB52 / README.md
Last active April 19, 2024 11:44
Testing ActiveRecord Concerns

Testing ActiveRecord Concerns

This gist illustrates the full spec suite of the example used in Testing ActiveRecord Concerns

Copy the testing-concerns.rb file and run rspec testing-concerns.rb

The output should look something like

... bundling ...
@ProGM
ProGM / arel_cheatsheet_on_steroids.md
Last active April 19, 2024 04:06
Arel cheatsheet on Steroids

Arel Cheatsheet on Steroids

A (more) complete cheatsheet for Arel, including NamedFunction functions, raw SQL and window functions.

Tables

posts = Arel::Table.new(:posts)
posts = Post.arel_table # ActiveRecord

Table alias

@thefranke
thefranke / RSS.md
Last active April 16, 2024 09:03
A list of RSS endpoints, readers and resources

The RSS Endpoint List

Please refer to this blogpost to get an overview.

Replace *-INSTANCE with one of the public instances listed in the scrapers section. Replace CAPITALIZED words with their corresponding identifiers on the website.

Social Media

Twitter