Skip to content

Instantly share code, notes, and snippets.

View gabrielpedepera's full-sized avatar

Gabriel Pereira gabrielpedepera

View GitHub Profile
defmodule SecurityTokenManager do
use GenServer
defstruct [:access_key, :secret_access, :security_token, :expires_at]
@security_token_size 20
@milliseconds_in_second 1000
@expires_in_seconds 60 * 15 # 15 minutes
def start_link do
@gabrielpedepera
gabrielpedepera / change-commits.sh
Created November 19, 2023 16:52
Script to change emails and/or names of commits
#!/bin/sh
git filter-branch -f --env-filter '
OLD_EMAIL="old@email.com"
CORRECT_NAME="Old Name"
CORRECT_EMAIL="new@email.com"
if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ]
then
@gabrielpedepera
gabrielpedepera / things-i-believe.md
Created September 9, 2021 21:57 — forked from stettix/things-i-believe.md
Things I believe

Things I believe

This is a collection of the things I believe about software development. I have worked for years building backend and data processing systems, so read the below within that context.

Agree? Disagree? Feel free to let me know at @JanStette. See also my blog at www.janvsmachine.net.

Fundamentals

Keep it simple, stupid. You ain't gonna need it.

Keybase proof

I hereby claim:

  • I am gabrielpedepera on github.
  • I am gabrielpedepera (https://keybase.io/gabrielpedepera) on keybase.
  • I have a public key ASAuV2ttcYiLr3Fc4R8xdy-lPvJDbFbZLIDFhEa520u0vwo

To claim this, I am signing this object:

@gabrielpedepera
gabrielpedepera / recursividade_hash_01.xml
Created March 14, 2017 11:48 — forked from prodis/recursividade_hash_01.xml
Ruby Fundamental - Usando recursividade para alterar valores de hash
<transaction>
<id>456</id>
<status>Aprovada</status>
<order_number>F2457</order_number>
<price>33.21</price>
<date_transaction>2012-12-13T12:35:30</date_transaction>
<date_release></date_release>
<payment>
<payment_method>Mastercard</payment_method>
<date_approval>2012-12-13T12:35:31</date_approval>
module.exports = {
config: {
copyOnSelect: true,
// default font size in pixels for all tabs
fontSize: 14,
// font family with optional fallbacks
fontFamily: '"Meslo LG S for Powerline", Menlo, "DejaVu Sans Mono", "Lucida Console", monospace',
inherit_from: .rubocop_todo.yml
AllCops:
Exclude:
- db/schema.rb
- db/migrate/*
- bin/*
RunRailsCops: true
Documentation:
@gabrielpedepera
gabrielpedepera / SublimeLinter.sublime-settings
Created August 29, 2016 02:04
SublimeLinter.sublime-settings
{
"user": {
"debug": false,
"delay": 0.25,
"error_color": "D02000",
"gutter_theme": "Packages/SublimeLinter/gutter-themes/Default/Default.gutter-theme",
"gutter_theme_excludes": [],
"lint_mode": "background",
"linters": {
"rubocop": {
# app/views/posts/show.html.erb
<br><br>
<h2>Comments</h2>
<div id="comments">
<%# render partial: 'comments/comment', collection: @posts.comments %>
<%= render @post.comments %>
</div>
<%= render 'comments/new', post: @post %>