Skip to content

Instantly share code, notes, and snippets.

View PauloLuan's full-sized avatar
💭
Ora et labora

Paulo Luan PauloLuan

💭
Ora et labora
View GitHub Profile
@PauloLuan
PauloLuan / Mensis_Eucharisticus.md
Last active July 16, 2021 08:43
Mensis Eucharisticus

"Mensis Eucharisticus"

Iº DIA

Preparação

  1. Quem vem? - Cristo, Rei dos séculos, (ITm 1, 17) incorruptível que sob o manto e o fêmur traz escrito o nome: Rei dos reis e Senhor dos senhores (Ap 19, 16).

  2. A quem vem? - Ao seu súdito, que lhe deve dez mil talentos e não tem nem mesmo um trocado para começar a saldar uma dívida tão grande (Mt 18, 24-25).

  3. Por que vem? - Não para desfazer-se daquele miserável servo e tomar-lhe tudo que tem; mas para conceder-lhe o preço (cf. Cl 2, 3) do seu Corpo e do seu Sangue, um tesouro imenso, bem maior que o débito a satisfazer (cf. ICor 6, 20).

@PauloLuan
PauloLuan / git.sh
Created March 8, 2021 12:32
git copy from another branch and foda-se the branch atual
git checkout master -- myfile.js
@PauloLuan
PauloLuan / linkedin_accpet_invitations.js
Created February 24, 2021 11:46
linkedin_accpet_invitations.js
// É só acessar: https://lnkd.in/dxFRjUe
(async function(){
await document.querySelectorAll(".invitation-card__action-container .artdeco-button--secondary").forEach(c => c.click())
})();
@PauloLuan
PauloLuan / find_sort_join_markdown_files.sh
Created December 31, 2020 19:16
find_sort_join_markdown_files.sh
find . -name "*.md" -mindepth 2 -type f -print | sort | xargs cat >> teste.md
@PauloLuan
PauloLuan / git_branchs_by_date.sh
Created September 15, 2020 12:43
Gist list all branches by date
git branch -av --sort=committerdate --format='%(refname:short) - %(committerdate:short) %(authorname)' > teste.txt
@PauloLuan
PauloLuan / jest-mock-date.ts
Created August 12, 2020 07:23
jest-mock-date.ts
describe('jest mock date example', () => {
let realDateInstance = Date
beforeAll(() => {
const mockedDate = new Date('2016-12-14T02:00:00.000Z')
global.Date = class extends Date {
constructor (date) {
if (date) {
return super(date)
}
@PauloLuan
PauloLuan / macas_v1.js
Created June 7, 2020 08:03
comprar_macas_algoritmo
Processo de comprar maçãs começa
Para quitanda 0, quitanda 1 e quitanda 2, execute em sequencia:
Processo de visitar a quitanda começa
Ir à quitanda
Se a quitanda não estiver aberta, termina o "processo de visitar quitanda" atual
Se não houverem maçãs nessa quitanda, termina o "processo de visitar quitanda" atual
Se não houverem maçãs Fuji nessa quitanda, termina o "processo e visitar quitanda" atual
Se houver menos de 1 kilo de maçãs Fuji nesta quitanda, termina o "processo de visitar quitanda" atual
Se o preço das maçãs Fuji nesta quitanda for maior que 1 dólar / kilo, executar 3 vezes:
Início do processo de barganha
@PauloLuan
PauloLuan / ffmpeg_1.5x.md
Last active February 25, 2023 22:54
ffmpeg 1.5x

To increase speed of a video by a factor of 1.5x:

ffmpeg -i input.mp4 -filter_complex "[0:v]setpts=PTS/1.5[v];[0:a]atempo=1.5[a]" -map "[v]" -map "[a]" output.mp4

We can use this to adjust the speed of all the videos in a directory (Linux and macOS only):

mkdir -p output
@PauloLuan
PauloLuan / nodejs_ipfs_api_example.js
Last active December 9, 2019 17:06
NodeJS IPFS API example
const express = require('express');
const ipfsClient = require('ipfs-http-client');
const ipfs = ipfsClient('http://localhost:5001');
const app = express();
app.use(express.json());
app.get('/', (req, res) => {
return res.send('Welcome to my IPFS app');
@PauloLuan
PauloLuan / instagram_follow_click_button.js
Created November 25, 2019 07:51
instagram_follow_click_button.js
const timeoutPromise = timeout =>
new Promise(resolve => setTimeout(resolve, timeout))
function contains (selector, text) {
var elements = document.querySelectorAll(selector)
return Array.prototype.filter.call(elements, function (element) {
const isFollowing = RegExp('Following').test(element.textContent)
const isRequested = RegExp('Requested').test(element.textContent)
console.log(element.textContent, { isFollowing, isRequested })