Skip to content

Instantly share code, notes, and snippets.

View brunnogomes's full-sized avatar

Brunno Gomes brunnogomes

View GitHub Profile
@nbenns
nbenns / k8s-alternative-mac
Created January 31, 2022 19:16
Install Podman and Kind on Mac to replace docker-desktop
brew install podman --head # you must use head due to issues with kind compatibility
# make sure docker desktop is deleted
sudo unlink /usr/local/bin/docker
sudo ln -s /usr/local/bin/podman /usr/local/bin/docker
podman machine init
podman machine start
podman machine ssh
@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
@kimsuelim
kimsuelim / _comment.html.slim
Created September 13, 2019 08:59 — forked from dbridges/_comment.html.slim
Stimulus.js and Rails remote forms with error handling
- # app/views/comments/_comment.html.slim
li data-controller="comment" data-action="click->comment#hello"
= "#{comment.message} by #{comment.user.email}"
@dbridges
dbridges / _comment.html.slim
Last active August 25, 2022 18:51
Stimulus.js and Rails remote forms with error handling
- # app/views/comments/_comment.html.slim
li data-controller="comment" data-action="click->comment#hello"
= "#{comment.message} by #{comment.user.email}"
@mrmartineau
mrmartineau / stimulus.md
Last active May 12, 2024 04:35
Stimulus cheatsheet
@ndbroadbent
ndbroadbent / has_uid.rb
Created November 30, 2017 13:56
UIDs in Rails
module HasUid
extend ActiveSupport::Concern
# Skips characters that look the same, such as 0 and O
UID_CHARS = 'abcdefghjkmnpqrstxyzACDEFGHJKLMNPQRSTXYZ2345679'.split('')
def self.generate_uid(length)
Array.new(length) {
UID_CHARS[SecureRandom.random_number(UID_CHARS.size)]
}.join
@wbotelhos
wbotelhos / clear-sidekiq-jobs.sh
Last active April 2, 2024 10:04
Clear Sidekiq Jobs
require 'sidekiq/api'
# 1. Clear retry set
Sidekiq::RetrySet.new.clear
# 2. Clear scheduled jobs
Sidekiq::ScheduledSet.new.clear
@SitePointEditors
SitePointEditors / dom-helper.js
Created March 28, 2017 09:56 — forked from m3g4p0p/dom-helper.js
Mini jQuery, sort of.
/**
* A collection of helper prototype for everyday DOM traversal, manipulation,
* and event binding. Sort of a minimalist jQuery, mainly for demonstration
* purposes. MIT @ m3g4p0p
*/
window.$ = (function (undefined) {
/**
* Duration constants
* @type {Object}
@zulhfreelancer
zulhfreelancer / heroku_pg_db_reset.md
Last active January 29, 2024 10:09
How to reset PG Database on Heroku (for Rails app)?

It's important to note that running this reset will drop any existing data you have in the application

How to reset PG Database on Heroku?

  • Step 1: heroku restart
  • Step 2: heroku pg:reset DATABASE (no need to change the DATABASE)
  • Step 3: heroku run rake db:migrate
  • Step 4: heroku run rake db:seed (if you have seed)

One liner