Skip to content

Instantly share code, notes, and snippets.

View george124816's full-sized avatar

George Rodrigues george124816

View GitHub Profile
# interactive command
gpg2 --full-generate-key
# get keyID
gpg2 --list-secret-keys --keyid-format=long
att .gitconfig with KEYID
`git config --global user.signingkey 3AA5C34371567BD2`
(defface tree-sitter-hl-face:warning
'((default :inherit font-lock-warning-face))
"Face for parser errors"
:group 'tree-sitter-hl-faces)
(defun hook/tree-sitter-common ()
(unless font-lock-defaults
(setq font-lock-defaults '(nil)))
(setq tree-sitter-hl-use-font-lock-keywords nil)
(tree-sitter-mode +1)
@edsoncelio
edsoncelio / requirements.md
Last active October 15, 2020 23:08
Requisitos para configuração do ambiente com a app VoteApp

Usando o projeto https://github.com/dockersamples/example-voting-app, fazer as seguintes alterações:
Importante: criar uma branch para cada alteração abaixo

Deployment by docker-compose

  1. No arquivo docker-compose.yml:
    • Verificar quais imagens são usados como base, e fazer o build externo e salvando em um registry (aplicando boas práticas de tageamento)
    • Retirar todos os builds e alterar para apontar para as imagens no registry usado
    • Usar docker volumes para persistir os dados
  2. Configurar CI com os seguintes requisitos (usar Github Actions ou TravisCI):
@wosephjeber
wosephjeber / instructions.md
Last active May 21, 2024 08:27
Ecto migration for renaming table with indexes and constraints

Renaming table in Ecto migration

I recently wanted to rename a model and its postgres table in a Phoenix app. Renaming the table was simple and documented, but the table also had constraints, sequences, and indexes that needed to be updated in order for the Ecto model to be able to rely on default naming conventions. I couldn't find any examples of what this would look like but was eventually able to figure it out. For anyone else in the same situation, hopefully this example helps.

In the example below, I'm renaming the Permission model to Membership. This model belongs to a User and an Account, so it has foreign key constraints that need to be renamed.

defmodule MyApp.Repo.Migrations.RenamePermissionsToMemberships do
  use Ecto.Migration
@streetturtle
streetturtle / sp
Last active April 29, 2024 03:13 — forked from wandernauta/sp
sp is a command-line client for Spotify's dbus interface. Play, pause, skip and search tracks from the comfort of your command line.
#!/bin/bash
#
# This is sp, the command-line Spotify controller. It talks to a running
# instance of the Spotify Linux client over dbus, providing an interface not
# unlike mpc.
#
# Put differently, it allows you to control Spotify without leaving the comfort
# of your command line, and without a custom client or Premium subscription.
#
@codenirvana
codenirvana / notify-send with sound
Created June 21, 2015 05:37
New email notify-send notification with sound
notify-send -u normal -i /usr/share/icons/Paper/64x64/apps/email.png "New Email" "${USER^} you have a new email!" && paplay /usr/share/sounds/freedesktop/stereo/message-new-instant.oga
@rdeavila
rdeavila / git-update-fork.sh
Last active February 19, 2024 16:02
Git: como atualizar um fork com as mudanças do original?
#!/bin/bash
# Adicione um novo remote; pode chamá-lo de "upstream":
git remote add upstream https://github.com/usuario/projeto.git
# Obtenha todos os branches deste novo remote,
# como o upstream/master por exemplo:
git fetch upstream
@wandernauta
wandernauta / sp
Last active May 14, 2024 16:49
sp is a command-line client for Spotify's dbus interface. Play, pause, skip and search tracks from the comfort of your command line.
#!/usr/bin/env bash
#
# This is sp, the command-line Spotify controller. It talks to a running
# instance of the Spotify Linux client over dbus, providing an interface not
# unlike mpc.
#
# Put differently, it allows you to control Spotify without leaving the comfort
# of your command line, and without a custom client or Premium subscription.
#