Skip to content

Instantly share code, notes, and snippets.

View hulous's full-sized avatar
🖖

Fabien Bénariac hulous

🖖
  • Lendopolis
  • Boussy Saint Antoine, France
  • 00:29 (UTC +02:00)
  • LinkedIn in/fbenariac
View GitHub Profile

How to deploy a Rails 7.1 app with Postgres and Kamal on a single server

I think you have looked at the tutorial from Mr. Heinemeier Hansson at least once or twice and have a similar setup.

rails new kamal_pg --css tailwind --skip-test --database=postgresql

cd kamal_pg
@lazaronixon
lazaronixon / rubocop.yml
Last active October 21, 2022 17:49
Basecamp Rubocop Template
# This template is inspired on https://github.com/basecamp/audits1984/blob/master/.rubocop.yml
#
# 1 - Add dependencies to group :development, :test
# gem "rubocop", "~> 1.26", require: false
# gem "rubocop-performance", require: false
# gem "rubocop-rails", require: false
#
# 2 - Create a file .rubocop.yml and add the lines below
# inherit_from: https://gist.githubusercontent.com/lazaronixon/7815d84702f277ead5e89c9f2aa5581f/raw/rubocop.yml
#
@hulous
hulous / Makefile
Last active September 25, 2023 07:45
Rails app Docker and docker-compose command abstraction
APPLICATION_NAME = app_name
WEB_CONTAINER_NAME = $(APPLICATION_NAME)-web
.DEFAULT_GOAL := help
CONTAINER_APP_MANAGER = docker ## Podman vs Docker
# Docker stuff
attach: ## Attach running web container to see logs
$(CONTAINER_APP_MANAGER) attach $(APPLICATION_NAME)_$(WEB_CONTAINER_NAME)_1
@deHelden
deHelden / "torn" 1 Setup vps.md
Last active June 9, 2024 00:31
Deploy Rails 7.0.4.2 to VPS(DigitalOcean Ubuntu 20). Nginx, Puma, Capistrano3, PostgreSQL, Rbenv.

SETUP VPS

based on DigitalOcean guide

Create local project

local$ rails new appname -T -d postgresql
local$ rails g scaffold Story title:string body:text
local$ rails db:migrate
@trev
trev / config.yml
Created May 25, 2018 01:23
CircleCI 2.0 with parallelism & simplecov for Rails
# Ruby CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-ruby/ for more details
defaults: &defaults
working_directory: ~/split_app
parallelism: 2
docker:
- image: circleci/ruby:2.5.0-node-browsers
@hulous
hulous / Makefile
Last active January 12, 2022 20:58
My standard c and cpp makefile template
## MAKEFILE FOR C PROJECT
MYAPP = application
HEADERS = $(MYAPP).h
OBJECTS = $(MYAPP).o
default: $(MYAPP)
%.o: %.c $(HEADERS)
gcc -c $< -o $@

FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.


Effective Engineer - Notes

What's an Effective Engineer?

@nicolai86
nicolai86 / sync-mysql-mina.rb
Last active December 3, 2018 07:17
sync down the content of a mysql database used by a ruby on rails application using mina.
RYAML = <<-BASH
function ryaml {
ruby -ryaml -e 'puts ARGV[1..-1].inject(YAML.load(File.read(ARGV[0]))) {|acc, key| acc[key] }' "$@"
};
BASH
namespace :sync do
task :db do
isolate do
invoke :environment
@ryansobol
ryansobol / gist:5252653
Last active November 22, 2023 11:53
15 Questions to Ask During a Ruby Interview

Originally published in June 2008

When hiring Ruby on Rails programmers, knowing the right questions to ask during an interview was a real challenge for me at first. In 30 minutes or less, it's difficult to get a solid read on a candidate's skill set without looking at code they've previously written. And in the corporate/enterprise world, I often don't have access to their previous work.

To ensure we hired competent ruby developers at my last job, I created a list of 15 ruby questions -- a ruby measuring stick if you will -- to select the cream of the crop that walked through our doors.

What to expect

Candidates will typically give you a range of responses based on their experience and personality. So it's up to you to decide the correctness of their answer.

@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active July 4, 2024 17:58
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname