Skip to content

Instantly share code, notes, and snippets.

View peimelo's full-sized avatar
👨‍💻
coding

Paulo Melo peimelo

👨‍💻
coding
View GitHub Profile
@peimelo
peimelo / database.ci.yml
Last active August 16, 2022 14:59
Ruby on Rails Tests - GitHub Actions + Publish code coverage
# config/database.ci.yml
test:
adapter: postgresql
encoding: unicode
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
database: <%= ENV["POSTGRES_DB"] %>
username: <%= ENV['POSTGRES_USER'] %>
password: <%= ENV["POSTGRES_PASSWORD"] %>
@peimelo
peimelo / application_service.rb
Created September 18, 2021 13:48
Devise: Password complexity
# app/services/application_service.rb
class ApplicationService
def self.call(*args, &block)
new(*args, &block).call
end
end
@peimelo
peimelo / api.ts
Last active December 12, 2023 14:05
Axios for devise_token_auth
import axios from 'axios';
import AsyncStorage from '@react-native-community/async-storage';
const api = axios.create({
baseURL: 'http://localhost:3000/api',
});
api.interceptors.request.use(async function (config) {
const accessToken = await AsyncStorage.getItem('@CHealth:access-token');
const client = await AsyncStorage.getItem('@CHealth:client');
@peimelo
peimelo / database.ci.yml
Last active October 18, 2024 06:59
Ruby on Rails Tests - GitHub Actions
# config/database.ci.yml
test:
adapter: postgresql
encoding: unicode
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
database: <%= ENV["POSTGRES_DB"] %>
username: <%= ENV['POSTGRES_USER'] %>
password: <%= ENV["POSTGRES_PASSWORD"] %>
@peimelo
peimelo / config.yml
Last active September 21, 2021 22:17
CircleCI Ruby/PostgreSQL
# .circleci/config.yml
version: 2.1
orbs:
ruby: circleci/ruby@1.0
jobs:
build:
docker:
- image: circleci/ruby:2.7.2
executor: ruby/default
@peimelo
peimelo / config.yml
Last active September 21, 2021 22:18
CircleCI - Ruby on Rails
# .circleci/config.yml
version: 2.1
orbs:
ruby: circleci/ruby@1.0
jobs:
build:
docker:
- image: circleci/ruby:2.6.6-stretch-node
executor: ruby/default
@peimelo
peimelo / .zshrc
Last active February 1, 2021 11:43
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
eval "$(rbenv init -)"
export PATH="/usr/local/opt/node@14/bin:$PATH"
ANDROID_HOME=/Users/melo/Library/Android/sdk
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_251.jdk/Contents/Home
@peimelo
peimelo / History|-10f5620e|entries.json
Last active February 12, 2023 20:38
Visual Studio Code Settings Sync Gist
{"version":1,"resource":"file:///Users/melo/Projects/Angular/controlled-health-frontend/src/app/exams/services/exams-facade.service.ts","entries":[{"id":"qela.ts","timestamp":1650461783059},{"id":"1DVY.ts","timestamp":1650462325935},{"id":"mUEH.ts","timestamp":1650462392089},{"id":"FCQI.ts","timestamp":1650463035177}]}