Skip to content

Instantly share code, notes, and snippets.

View matiasmasca's full-sized avatar
🏠
Moving to Gitlab.com

Matías Mascazzini matiasmasca

🏠
Moving to Gitlab.com
View GitHub Profile
@jjb
jjb / file.md
Last active March 13, 2025 15:18
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 ; \
@etozzato
etozzato / puma.rb
Last active January 28, 2024 20:12
A section of config/puma.rb that will automatically generate a self-signed X509 certificate and provide https in development
if Rails.env.development?
FileUtils.mkdir_p(Rails.root.join('config', 'certs'))
key_path = Rails.root.join('config', 'certs', 'development.key')
crt_path = Rails.root.join('config', 'certs', 'development.crt')
unless File.exist?(key_path) && File.exist?(crt_path)
def cert_domain
'localhost' # Setting[:cookie_domain] || 'localhost'
end
@donrestarone
donrestarone / test-docker-entrypoint.sh
Created December 27, 2020 16:36
docker-entrypoint for test rails
#!/bin/sh
set -e
echo "Environment: $RAILS_ENV"
# Check if we need to install new gems
bundle check || bundle install --jobs 20 --retry 5
# Then run any passed command
@donrestarone
donrestarone / docker-compose.yml
Last active April 2, 2025 15:12
simple docker-compose file for dockerizing the restarone website
version: '3'
networks:
development:
test:
volumes:
db_data:
gem_cache:
shared_data:
services:
restarone_redis:
@donrestarone
donrestarone / Dockerfile.dev
Created December 27, 2020 15:51
simple dockerfile for setting up the dependencies for a rails application
FROM ruby:2.6.6-alpine
ENV APP_PATH /var/app
ENV BUNDLE_VERSION 2.1.4
ENV BUNDLE_PATH /usr/local/bundle/gems
ENV TMP_PATH /tmp/
ENV RAILS_LOG_TO_STDOUT true
ENV RAILS_PORT 3000
# copy entrypoint scripts and grant execution permissions
@dhh
dhh / Gemfile
Created June 24, 2020 22:23
HEY's Gemfile
ruby '2.7.1'
gem 'rails', github: 'rails/rails'
gem 'tzinfo-data', '>= 1.2016.7' # Don't rely on OSX/Linux timezone data
# Action Text
gem 'actiontext', github: 'basecamp/actiontext', ref: 'okra'
gem 'okra', github: 'basecamp/okra'
# Drivers
@nicolasdao
nicolasdao / elasticbeanstalk_guide.md
Last active January 9, 2025 12:34
Elastic Beanstalk guide. Keywords: elastic bean beanstalk elasticbeanstalk cli eb eb
server {
listen 80;
server_name kartoffel.example.org;
keepalive_timeout 5;
root /var/www/kartoffel/current/public;
access_log /var/log/nginx/kartoffel.access.log;
server {
client_max_body_size 30M;
server_name sistema.example.com.ar;
# ~2 seconds is often enough for most folks to parse HTML/CSS and
# retrieve needed images/icons/frames, connections are cheap in
# nginx so increasing this is generally safe...
keepalive_timeout 5;
@khalilgharbaoui
khalilgharbaoui / db.rake
Created February 3, 2019 21:29 — forked from hopsoft/db.rake
Rails rake tasks for dump & restore of PostgreSQL databases
# Original source: https://gist.github.com/hopsoft/56ba6f55fe48ad7f8b90
# Merged with: https://gist.github.com/kofronpi/37130f5ed670465b1fe2d170f754f8c6
# Benefits of: https://gist.github.com/e12e/e0c7d2cc1d30d18c8050b309a43450ac
# And fixes of: https://gist.github.com/joelvh/f50b8462611573cf9015e17d491a8a92
namespace :db do
desc 'Dumps the database to backups'
task dump: :environment do
dump_fmt = ensure_format(ENV['format'])
dump_sfx = suffix_for_format(dump_fmt)
backup_dir = backup_directory(Rails.env, create: true)