Skip to content

Instantly share code, notes, and snippets.

View schweigert's full-sized avatar
🥝
λxy.x

Marlon Henry Schweigert schweigert

🥝
λxy.x
View GitHub Profile
@schweigert
schweigert / install.sh
Created November 11, 2021 14:16
Install bundler version from Gemfile.lock
gem install bundler -v "$(grep -A 1 "BUNDLED WITH" Gemfile.lock | tail -n 1)"
@luzfcb
luzfcb / template_LGPD.md
Last active July 22, 2024 03:30
Template LGPD - Template para solicitar exclusão de dados conforme a LGPD - Lei Geral de Proteção de Dados do brasil. LEI Nº 13.709, DE 14 DE AGOSTO DE 2018. Disclaimer: Não sou advogado e não me responsabilizo por qualquer coisa decorrente do uso desde conteudo. Use por sua conta e risco.

Olá <NOME_EMPRESA>.

Vocês estão me enviando <email, ligação, SMS, via plataforma Whatsapp, via plataforma Telegram> comerciais não-solicitados, portanto SPAM.

No dia vocês enviaram ao meu uma mensagem comércial, com o seguinte texto:

<MENSAGEM>

Manjaro Post Install

import Test.HUnit
data NaturalNote = C | D | E | F | G | A | B deriving (Show, Eq, Enum)
data Note = Natural NaturalNote | Sharp NaturalNote | Flat NaturalNote deriving (Show, Eq)
data Interval = Half | Whole
type Jump = [Interval]
notes = cycle [Natural C,
Sharp C,
@jarifibrahim
jarifibrahim / cleaner.go
Last active February 9, 2024 16:37
Database cleanup hook using GORM
// DeleteCreatedEntities sets up GORM `onCreate` hook and return a function that can be deferred to
// remove all the entities created after the hook was set up
// You can use it as
//
// func TestSomething(t *testing.T){
// db, _ := gorm.Open(...)
//
// cleaner := DeleteCreatedEntities(db)
// defer cleaner()
//
package main
import (
"fmt"
"crypto/sha256"
"encoding/hex"
)
func main() {
s := "123123"
@miguelmota
miguelmota / rsa_util.go
Last active July 11, 2024 08:40
Golang RSA encrypt and decrypt example
package ciphers
import (
"crypto/rand"
"crypto/rsa"
"crypto/sha512"
"crypto/x509"
"encoding/pem"
"log"
)
@vtno
vtno / circle.yml
Created November 2, 2017 09:17
My CircleCI 1.0 configuration to enable Chrome headless.
dependencies:
pre:
# install chrome
- wget -N https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb -P ~/
- sudo dpkg -i --force-depends ~/google-chrome-stable_current_amd64.deb
- sudo apt-get -f install -y
- sudo dpkg -i --force-depends ~/google-chrome-stable_current_amd64.deb
- sudo rm /usr/local/bin/chromedriver
# install chromedriver
- wget -N http://chromedriver.storage.googleapis.com/$CHROME_DRIVER_VERSION/chromedriver_linux64.zip -P ~/
@asukakenji
asukakenji / go-stdlib-interface-selected.md
Last active July 22, 2024 10:08
Go (Golang) Standard Library Interfaces (Selected)

Go (Golang) Standard Library Interfaces (Selected)

This is not an exhaustive list of all interfaces in Go's standard library. I only list those I think are important. Interfaces defined in frequently used packages (like io, fmt) are included. Interfaces that have significant importance are also included.

All of the following information is based on go version go1.8.3 darwin/amd64.

@subfuzion
subfuzion / dep.md
Last active June 14, 2023 15:46
Concise guide to golang/dep

Overview

This gist is based on the information available at golang/dep, only slightly more terse and annotated with a few notes and links primarily for my own personal benefit. It's public in case this information is helpful to anyone else as well.

I initially advocated Glide for my team and then, more recently, vndr. I've also taken the approach of exerting direct control over what goes into vendor/ in my Dockerfiles, and also work from isolated GOPATH environments on my system per project to ensure that dependencies are explicitly found under vendor/.

At the end of the day, vendoring (and committing vendor/) is about being in control of your dependencies and being able to achieve reproducible builds. While you can achieve this manually, things that are nice to have in a vendoring tool include: