Skip to content

Instantly share code, notes, and snippets.

View wnqueiroz's full-sized avatar
:octocat:

William Queiroz wnqueiroz

:octocat:
View GitHub Profile
@wnqueiroz
wnqueiroz / next-js-12-factor-app-support.sh
Created April 23, 2024 17:20
Next.js 12-factor App Support
# -------------------------- .docker/entrypoint.sh --------------------------
#!/bin/bash
DIR=".next"
find "${DIR}" -type f | while read -r file; do
for var in $(env | cut -d= -f1 | grep '^NEXT_PUBLIC'); do
PATTERN="\$${var}"
NEW_VALUE=$(eval echo "\$$var")
SED_COMMAND="s|${PATTERN}|${NEW_VALUE}|g"
@rponte
rponte / using-uuid-as-pk.md
Last active May 13, 2024 08:21
Não use UUID como PK nas tabelas do seu banco de dados

Pretende usar UUID como PK em vez de Int/BigInt no seu banco de dados? Pense novamente...

TL;TD

Não use UUID como PK nas tabelas do seu banco de dados.

Um pouco mais de detalhes

@JamieMason
JamieMason / group-objects-by-property.md
Created September 14, 2018 07:38
Group Array of JavaScript Objects by Key or Property Value

Group Array of JavaScript Objects by Key or Property Value

Implementation

const groupBy = key => array =>
  array.reduce((objectsByKeyValue, obj) => {
    const value = obj[key];
    objectsByKeyValue[value] = (objectsByKeyValue[value] || []).concat(obj);
    return objectsByKeyValue;
@nikhita
nikhita / update-golang.md
Last active May 15, 2024 08:27
How to update the Go version

How to update the Go version

System: Debian/Ubuntu/Fedora. Might work for others as well.

1. Uninstall the exisiting version

As mentioned here, to update a go version you will first need to uninstall the original version.

To uninstall, delete the /usr/local/go directory by:

@ygotthilf
ygotthilf / jwtRS256.sh
Last active May 17, 2024 22:39
How to generate JWT RS256 key
ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key
# Don't add passphrase
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub
cat jwtRS256.key
cat jwtRS256.key.pub

Docker Container Name

A one paragraph description about the container.

Getting Started

These instructions will cover usage information and for the docker container

Prerequisities

@JamesMGreene
JamesMGreene / gitflow-breakdown.md
Last active May 3, 2024 12:32
`git flow` vs. `git`: A comparison of using `git flow` commands versus raw `git` commands.

Initialize

gitflow git
git flow init git init
  git commit --allow-empty -m "Initial commit"
  git checkout -b develop master

Connect to the remote repository