Skip to content

Instantly share code, notes, and snippets.

View RenatoRosaFranco's full-sized avatar
🎯
Focusing on quality code.

Renato Rosa Franco RenatoRosaFranco

🎯
Focusing on quality code.
View GitHub Profile
@RenatoRosaFranco
RenatoRosaFranco / seed_runner.rb
Created October 14, 2023 15:04
Ruby on Rails seed runner make a proof.
# frozen_string_literal: true
require 'benchmark'
require 'logger'
# Directory path where your seed files are located.
seed_files_directory = File.jsoin(Rails.root, 'db', 'seeds')
# Create a logger for better log management.
logger = Logger.new('seed_runner.log')
@RenatoRosaFranco
RenatoRosaFranco / build.sh
Created September 22, 2023 21:30
build.sh for Makefile as prof
#!/bin/bash
result=0
export BUNDLE_GEMFILE=`pwd`/Gemfile
bundle config set specific_platform true
echo "[○] Running drop DB"
bundle exec rails db:drop
@RenatoRosaFranco
RenatoRosaFranco / server.sh
Created September 22, 2023 21:24
server.sh for Makefile as prof
#!/bin/bash
if [ -f tmp/pids/server.pid ]; then
rm tmp/pids/server.pid
fi
for n in {1..6}; do
(bundle exec rails db:migrate ||
echo "Database setup/migration failed. Retry in 10s...") && break
sleep 10
@RenatoRosaFranco
RenatoRosaFranco / finder.sh
Created September 22, 2023 21:24
finder.sh for Makefile as prof
#!/bin/bash
if [[ -n $IS_ACTION && $IS_ACTION == 'Action' ]]; then
RUN_ALL='false';
else
RUN_ALL='true';
fi;
FINDER=$(find . -name test.sh | sort);
@RenatoRosaFranco
RenatoRosaFranco / Makefile
Last active September 23, 2023 01:49
RAILS Makefile as Prof
APP = app_name
DCMP = docker-compose
TEST_CONFIG = ${DCMP} -f docker-compose.yml
DCMP_EXEC_APP = ${TEST_CONFIG} exec ${APP}
DCMP_RUN_APP = ${TEST_CONFIG} run ${APP}
DCMP_TEST = @[ "$(BUILD)" = "dev" ] && ${TEST_CONFIG}
BUNDLE = bundle exec
RAILS = ${BUNDLE} rails
@RenatoRosaFranco
RenatoRosaFranco / decode_encode.dart
Last active June 25, 2023 17:03
Dart JSON encode-decode example
// frozen_string_literal: true
import 'dart:convert';
conversaoDireta() {
print('JSON conversão direta');
String jsonData = '''
{
"nome": "Renato Franco",
@RenatoRosaFranco
RenatoRosaFranco / youtube-video-commands
Created June 2, 2020 20:14 — forked from ThomasBush/youtube-video-commands
Ubuntu 20.04 Focal Fossa Rails server setup
# Generate Random Passwords
curl 'https://www.random.org/passwords/?num=2&len=24&format=plain&rnd=new'
# Create deploy user
sudo adduser deploy
sudo adduser deploy sudo
su deploy
cd ../deploy/
# Generate ssh keys 
@RenatoRosaFranco
RenatoRosaFranco / meta-tags.md
Created March 22, 2020 20:23 — forked from lancejpollard/meta-tags.md
Complete List of HTML Meta Tags

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta name="keywords" content="your, tags"/>
<meta name="description" content="150 words"/>
<meta name="subject" content="your website's subject">
<meta name="copyright"content="company name">
<meta name="language" content="ES">
@RenatoRosaFranco
RenatoRosaFranco / API.md
Created January 6, 2020 19:57 — forked from iros/API.md
Documenting your REST API

Title

<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>

  • URL

    <The URL Structure (path only, no root url)>

  • Method:

@RenatoRosaFranco
RenatoRosaFranco / hyper-renato.js
Created September 22, 2019 00:33
Hyper config
module.exports = {
config: {
// choose either `'stable'` for receiving highly polished,
// or `'canary'` for less polished but more frequent updates
updateChannel: 'stable',
// default font size in pixels for all tabs
fontSize: 20,
// font family with optional fallbacks