Skip to content

Instantly share code, notes, and snippets.

View MatheusRich's full-sized avatar
🤔
Always learning, always changing

Matheus Richard MatheusRich

🤔
Always learning, always changing
View GitHub Profile
@MatheusRich
MatheusRich / chatgpt.md
Last active June 16, 2023 18:37
Google Translate vs. ChatGPT: What About Portuguese?
title teaser author
Trabalhar no meu idioma nativo requer empatia
É exaustivo passar o dia todo se comunicando em um idioma que não é o nativo, mas podemos praticar a gentileza e a compreensão para aliviar parte dessa carga mental.
Matheus Richard

Algumas semanas atrás, eu estava conversando com um colega de trabalho e

@MatheusRich
MatheusRich / hacking-ruby-resources.md
Last active July 8, 2023 15:10
Hacking CRuby Resources

Hacking Ruby Resources

Some resources for people interested in hacking the CRuby (MRI) code base.

CRuby

Garbage Collection

@MatheusRich
MatheusRich / jekyll_erb.rb
Created January 13, 2024 02:13
Hacky ERB post-processor to Jekyll
module EmbeddedRuby
module ErbRenderer
class Context
def initialize(variables)
variables.each do |key, value|
instance_variable_set(:"@#{key}", value)
self.class.attr_reader key
end
end
@MatheusRich
MatheusRich / request.rb
Last active November 26, 2024 04:49
Request Specs vs. System Specs Comparison
require "rails_helper"
RSpec.describe "User management", type: :request do
# Runs in about 0.2 seconds (excluding file load time)
it "lists existing users" do
User.create!(name: "John", age: 30)
get users_path
expect(page).to have_table "Users" do |table|
@MatheusRich
MatheusRich / compress_video
Created August 22, 2024 15:42 — forked from trvswgnr/compress_video
portable shell script to compress videos with ffmpeg
#!/bin/sh
print_usage() {
echo "usage: compress_video <input_file>"
echo "supported formats: mp4, webm, mkv, mov, avi, flv"
}
get_extension() {
f="${1##*/}"
case "$f" in