Skip to content

Instantly share code, notes, and snippets.

View paulera's full-sized avatar

Paulo Amaral paulera

View GitHub Profile
@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 / 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 / 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 / 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 / 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 / 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 / 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 / burndown.html
Last active July 15, 2021 07:31
Burndown chart built using Chart.js
<html>
<!-- See live at https://codepen.io/paulera/pen/ejGKEr -->
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.5.0/Chart.min.js"></script>
<script>
/**
* Sum elements of an array up to the index provided.
*/
@paulera
paulera / gimme.sh
Last active November 16, 2020 11:22
Switch branch and pull changes (fetch + checkout + pull) preserving local changes (using stash)
#!/bin/bash
git1() {
STASH="gimme-cmd-stash-"$(date +"%s")i
git stash save $STASH
STASH_REF="$(git stash list | grep "$STASH" | awk -F: '{ print $1 }')"
git fetch && git checkout $1 && git pull
if [ "$STASH_REF" != "" ]; then
git stash pop "$STASH_REF"
else
@paulera
paulera / browser-auto-scroll.md
Last active April 18, 2021 21:42
Smart bookmarks that add auto-scrolling functionality to the browser

Create bookmarks as per below to automate scrolling

Name URL
slower javascript:if (typeof window.scrollLines === 'undefined') { window.scrollLines = 1; } if (typeof window.scrollInterval === 'undefined') { window.scrollInterval = 1; } ; if (window.scrollLines > 1) { window.scrollLines--; window.scrollInterval = 1; } else { window.scrollLines = 1; window.scrollInterval += 25; }; clearInterval(window.scrollHandler) ; window.scrollHandler = setInterval(function() { window.scrollBy(0, window.scrollLines); }, window.scrollInterval ); window.scrollLines; window.scrollInterval;
pause javascript:clearInterval(window.scrollHandler);
play `javascript: if (typeof window.scrollLines === 'undefined') { window.scrollLines = 1; } ; if (typeof window.scrollInterval === 'undefined') { window.scrollInterval = 1; } ; clearInterval(window.scrollHandler) ; window.scrollHandler = setInterval(function() { window.scrollBy(0, window.scrollLines); }, window.scrollInt