Skip to content

Instantly share code, notes, and snippets.

View paulera's full-sized avatar

Paulo Amaral paulera

View GitHub Profile
@paulera
paulera / python3_flask_dreamhost.sh
Last active August 3, 2024 12:22
Script to install python3 + virtualenv + flask, and setup passenger, for Dreamhost shared hosting.
#!/bin/bash
# ---------- SETUP --------------
SITE="unforgivenexception.com"
APP_FOLDER="app"
VIRTUALENV_FOLDER="env"
PYTHON_VERSION="3.5.6"
# ----------------------------------------------
@paulera
paulera / list-branches.sh
Last active May 16, 2022 16:32
Script to show the current branch of all subfolders that are git repos.
#!/bin/bash
# This script will show the current branch of all subdirs in a directory
# source: https://gist.github.com/paulera/fed7e4f8ac150dd2a05180ae1ac241b1
if [ "$1" == "--help" ]
then
echo "List the current branch of all subfolders that are GIR repos"
echo "Usage: $(basename $0) [folder]"
echo
@paulera
paulera / charts_hex_palette.md
Created January 23, 2019 19:54
Chart hexadecimal palette

Hexadecimal colours palette to use in charts

#ff3b3b
#30e5ff
#37ff30
#ff38ed
#ffbc3c
#362fff
#e8ff2f
@paulera
paulera / pyyaml_yes_no.py
Created March 12, 2019 01:43
Make PyYAML stop converting yes/no to true/false
# ref: https://stackoverflow.com/questions/36463531/pyyaml-automatically-converting-certain-keys-to-boolean-values
from yaml.constructor import Constructor
def add_bool(self, node):
return self.construct_scalar(node)
Constructor.add_constructor(u'tag:yaml.org,2002:bool', add_bool)
# code continues here ...
@paulera
paulera / auto.js
Last active April 13, 2019 23:32
A collection of javascript functions that I use in my browser automations
var auto = {
insist_timeout: 3000,
insist_snooze: 500,
/**
* Pauses execution for <tt>delay</tt> milisseconds
* @param {number} [delay=1000] Delay in milisseconds.
*/
sleep: function (delay = 1000) {
@paulera
paulera / youtube_ad_skipper.js
Last active September 16, 2021 12:25
Close youtube ads as soon as they show (video ads and banners)
// ==UserScript==
// @name AdSkipper
// @namespace https://gist.github.com/paulera/671daf5b9a5f6502697359941ba524dc
// @version 1.3
// @description Skip youtube ads automatically
// @author paulera
// @match https://www.youtube.com/*
// @grant none
// ==/UserScript==
@paulera
paulera / commit_message.md
Created May 22, 2019 10:01 — forked from lucasmezencio/commit_message.md
Como escrever a mensagem de um commit

As mensagens dos commits devem servir para três importantes coisas:

  • Para acelerar o processo de revisão.
  • Para ajudar a escrever uma boa nota de lançamento.
  • Para ajudar os futuros mantenedores (que pode ser você), ou ajudar a descobrir porque uma mudança foi feita no código ou porque uma funcionalidade foi adicionada.

Escreva sua mensagem de commit desta forma:

@paulera
paulera / commit_message.md
Created May 22, 2019 10:01 — forked from lucasmezencio/commit_message.md
Como escrever a mensagem de um commit

As mensagens dos commits devem servir para três importantes coisas:

  • Para acelerar o processo de revisão.
  • Para ajudar a escrever uma boa nota de lançamento.
  • Para ajudar os futuros mantenedores (que pode ser você), ou ajudar a descobrir porque uma mudança foi feita no código ou porque uma funcionalidade foi adicionada.

Escreva sua mensagem de commit desta forma:

/**
* Make this program to print 13 making changes ONLY the body of the "function" function
* You are NOT ALLOWED to change NOTHING in the "main" function
*/
void function() {
/* EDIT ONLY HERE */
}
int main() {
document.getElementById('ghx-header').style.display = 'none';
document.getElementById('ghx-quick-filters').style.display = 'none';
document.getElementById('navigation-app').style.display = 'none';
// document.getElementById('gh').style.height = '100%';
// document.getElementById('ghx-content-main').style.height = '100%';
// document.getElementById('ghx-rabid').style.height = '100%';
document.getElementById('ghx-plan').style.height = '100%';
document.getElementById('ghx-plan-group').style.height = '100%';