Skip to content

Instantly share code, notes, and snippets.

View luispimenta's full-sized avatar
🎯
Focusing

Luis Fernando Pimenta luispimenta

🎯
Focusing
View GitHub Profile
@luispimenta
luispimenta / ror-api.markdown
Created August 20, 2025 12:48 — forked from withoutwax/ror-api.markdown
Guide on how to create an API-Only Application with Ruby on Rails 5

Creating an API-Only Application with Ruby on Rails

01 - Create a new API-only Rails app

rails new ror-app-name --api

02 - Basic Scaffold

01 - Model

This step is for creating a very basic level of model for us to work in. If you know already, or wish to apply your own custom models with relationships you can skip this step.

@betogrun
betogrun / setup.sh
Created May 14, 2024 20:26
Setup ubuntu
#!/bin/bash
# Exit immediately if a command exits with a non-zero status
set -e
# Logging function
log() {
echo "$(date '+%Y-%m-%d %H:%M:%S') - $1" | tee -a /var/log/setup_script.log
}
@eduardo-mior
eduardo-mior / Lista de Órgãos Emissores
Last active February 6, 2026 13:08
Lista completa de órgãos emissores de documentos de identificação.
ABNC - Academia Brasileira de Neurocirurgia
AGU - Advocacia-Geral da União
ANAC - Agência Nacional de Aviação Civil
CAER - Clube de Aeronáutica
CAU - Conselho de Arquitetura e Urbanismo
CBM - Corpo de Bombeiro Militar
CFA - Conselho Federal Administração
CFB - Conselho Federal de Biblioteconomia
CFBIO - Conselho Federal de Biologia
CFBM - Conselho Federal de Biomedicina
@juuh42dias
juuh42dias / Post-RubyRails.md
Last active January 30, 2026 13:44 — forked from lucasnogueira/Post-RubyRails.md
Para aprender Ruby e Rails

É difícil falar de Ruby sem mencionar seu framework web mais famoso, Ruby on Rails. Mas não adianta muito encarar o framework sem um prévio estudo da linguagem (o que de fato já observei acontecer inúmeras vezes). Esse post tem como intuito auxiliar na aprendizagem tanto da linguagem como do framework, para evitar que erros comuns como esse tornem a utilização de ambos um desastre.

Ruby

Ruby é uma linguagem de programação que apareceu para o mundo em 1995, criada por Yukihiro "Matz" Matsumoto. Tem como características o fato de ser uma linguagem de uso geral, com tipagem dinâmica e forte, orientada a objetos e que incorpora diversos paradigmas de programação, como o funcional e o imperativo.

Iniciantes

  • Conhecendo Ruby - "Conhecendo Ruby Sempre quis aprender a linguagem Ruby mas não encontrava material em Português com bastante conteúdo? Seus problemas acabaram! Aqui está um dos mais completos livros de Ruby em Português
@jnettome
jnettome / iugu_concerns.rb
Created April 16, 2018 18:06
create marketplace account on iugu (iugu-ruby)
# Using the iugu-ruby gem's fork from https://github.com/jnettome/iugu-ruby
module IuguConcerns
extend ActiveSupport::Concern
included do
def generate_iugu_subaccount!
return iugu_receiver_id if iugu_receiver_id
account = Iugu::Account.create(name: name, commission_percent: 0)
return fail account.errors.to_s if account.errors
@withoutwax
withoutwax / ror-api.markdown
Last active August 20, 2025 12:48
Guide on how to create an API-Only Application with Ruby on Rails 5

Creating an API-Only Application with Ruby on Rails

01 - Create a new API-only Rails app

rails new ror-app-name --api

02 - Basic Scaffold

01 - Model

This step is for creating a very basic level of model for us to work in. If you know already, or wish to apply your own custom models with relationships you can skip this step.

@checco
checco / rw_ro_access.sql
Last active November 28, 2025 14:24 — forked from oinopion/read-access.sql
How to create a read only user in AWS RDS PostgreSQL and a user with superuser privileges on AWS RDS PostgreSQL
--
-- Read only
--
-- Create a group
CREATE ROLE postgres_ro_group;
-- Grant access to existing tables
GRANT USAGE ON SCHEMA public TO postgres_ro_group;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO postgres_ro_group;
@fjahr
fjahr / application.html.erb
Last active October 4, 2021 10:35 — forked from suryart/application.html.erb
Displaying Rails 5 flash messages with Twitter Bootstrap 4 (last tested on Alpha-v6). Updated version of https://gist.github.com/suryart/7418454
// layout file
<body>
<div class="container">
<%= flash_messages %>
<%= yield %>
</div><!-- /container -->
</body>
@cusspvz
cusspvz / 99-login-fon
Last active September 11, 2021 00:58
FON ZON / NOS auto-login bash script wget portugal non-wispr client openwrt
#!/bin/sh
# place this file at: /etc/hotplug.d/iface/99-login-fon
# Configurations
FON_USERNAME=email%40domain.com
FON_PASSWORD=123456
FON_DELAY_UP=3
COOKIE_JAR_PATH=/tmp/nos-fon-cookie-jar.$INTERFACE
. /lib/functions.sh

Javascript

function cpfMask(cleanValue) {
  return cleanValue.replace(/^(\d{3})(\d{3})(\d{3})(\d{2}).*/, '$1.$2.$3-$4');
}

function cnpjMask(cleanValue) {
  return cleanValue.replace(/^(\d{2})(\d{3})(\d{3})(\d{4})(\d{2}).*/, '$1.$2.$3/$4-$5');
}