Skip to content

Instantly share code, notes, and snippets.

View Wendersonandes's full-sized avatar

Wenderson Fernandes Wendersonandes

  • Emerge
  • Belo Horizonte, Brazil
View GitHub Profile
@pixeldevsio
pixeldevsio / HumanMade S3 Digital Ocean Instructions
Last active May 2, 2024 06:57
Use HumanMade S3 plugin with Digital Ocean Spaces
These are the two steps you need to take to get S3 to work with Digital Ocean Spaces.
https://github.com/humanmade/S3-Uploads
@blocknotes
blocknotes / setup.md
Last active February 24, 2025 15:40
ActiveAdmin Trix editor setup (tested with Rails 6.0.3.3)
  • Setup the Rails project with ActiveAdmin using Webpacker: rails g active_admin:install --use_webpacker
  • Setup Trix editor for ActiveAdmin:
    • Execute: bin/rails action_text:install
    • Add Javascript library to app/javascript/packs/active_admin.js:
require("trix")
require("@rails/actiontext")
  • Add style library to app/javascript/stylesheets/active_admin.scss:
@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
@rjekic
rjekic / wp.sh
Last active March 18, 2025 20:48 — forked from bgallagh3r/wp.sh
Wordpress: Bash Install Script using wp-cli
#!/bin/bash -e
clear
echo "============================================"
echo "WordPress Install Script"
echo "============================================"
# Gathering database login credentials from user input
read -p "Database Host: " dbhost
read -p "Database Name: " dbname
read -p "Database User: " dbuser
@tbcooney
tbcooney / business_hours.rb
Created August 21, 2019 04:07
Serialization TimeOfDay with Rails and jsonb
#!/usr/bin/env ruby
# Supplies TimeOfDay class that includes parsing, strftime, comparison, and arithmetic
gem 'tod', '~> 2.2'
ActiveRecord::Schema.define do
add_column :businesses, :force => true do |t|
t.jsonb :business_hours
end
end
@aurelioluiz
aurelioluiz / dokku-digitalocean.md
Last active June 1, 2024 11:28
Aplicação Rails com Dokku na DigitalOcean

Aplicação Rails com Dokku na DigitalOcean

Etapas para configuração de uma aplicação em Rails na DigitalOcean usando o Dokku para deploy. A documentação completa está disponível em http://dokku.viewdocs.io/dokku/getting-started/installation

Requisitos

  • DigitalOcean droplet Ubuntu 18.04
  • Dokku 1-click installation
  • Aplicação Rails no GitHub

Criando usuário deploy

Acesse o droplet como root

@aonemd
aonemd / subtitle_extractor.rb
Last active December 4, 2025 09:01
A Ruby script to extract text from images with subtitles and rename the image file to the extracted text (requires Tesseract to be installed)
require 'pathname'
require 'open3'
require 'mini_magick'
SRC_DIR = '/path/to/src/dir/'.freeze
TMP_DIR = '/path/to/tmp/dir/'.freeze
class TextReader
def initialize(input_path, output_path)
@input_path = input_path
@zulhfreelancer
zulhfreelancer / fix-bundle-install-network-error.md
Last active October 30, 2023 05:34
How to fix bundle install 'network error while fetching' issue on Mac OSX?

If you get something like this when running bundle install...

Network error while fetching https://rubygems.org/quick/Marshal.4.8/xxx-x.x.x.gemspec.rz (execution expired)

...this solution might work for you.

First, make sure you have tried all the troubleshoot solutions here.

@db0sch
db0sch / regenerate_credentials.md
Last active January 20, 2026 18:27
How to regenerate the master key for Rails 5.2 credentials

If your master.key has been compromised, you might want to regenerate it.

No key regeneration feature at the moment. We have to do it manually.

  1. Copy content of original credentials rails credentials:show somewhere temporarily.
  2. Remove config/master.key and config/credentials.yml.enc
  3. Run EDITOR=vim rails credentials:edit in the terminal: This command will create a new master.key and credentials.yml.enc if they do not exist.
  4. Paste the original credentials you copied (step 1) in the new credentials file (and save + quit vim)
  5. Add and Commit the file config/credentials.yml.enc
@henriqueutsch
henriqueutsch / Gemfile
Last active August 22, 2018 12:46
Migrar posts medium rotinas
source 'https://rubygems.org'
gem 'string-similarity'
gem 'activesupport'
gem 'nokogiri'
gem "awesome_print"
gem 'colorize'