Skip to content

Instantly share code, notes, and snippets.

View guibeira's full-sized avatar
🏠
Working from home

Guilherme de S. Vieira Beira guibeira

🏠
Working from home
View GitHub Profile
@guibeira
guibeira / Install dojotimer step-by-step
Last active March 24, 2019 16:30
Install dojo timer
sudo apt install gtk-sharp2 # install dependencies
sudo apt install mono-complete
wget https://teamcity.jetbrains.com/guestAuth/repository/download/cb_bt402/.lastSuccessful/dojotimer.exe # download binary file
sudo chmod 755 dojotimer.exe # give permissions
sudo mv dojotimer.exe /bin/dojotimer
# now just type `dojotimer`
#Para quem tem que deletar muita msg das dead_queue,
#e tem que selecionar uma a uma quais msg deseja excluir.
#Seus problemas acabaram! abra a fila clique em visualizar e buscar e no console cole isso:
function find_and_delete_many(to_find){
for (let item of to_find) {
console.log(item)
$("div[style='overflow:hidden;white-space:nowrap;']").each(function( index ) {
var text_to_validate = $(this).text()
@guibeira
guibeira / mp3_donwloader.py
Last active January 26, 2021 21:12
Python script to donwload and converter youtube videos to MP3
import asyncio
import functools
import itertools
import time
DONWLOAD_COMMAND = "youtube-dl -x -i -q --audio-format mp3 --audio-quality 0 --embed-thumbnail --no-playlist --no-warnings {}"
musics = [ # examples of musics to donwload
"https://www.youtube.com/watch?v=iJPX8zyUmxQ",
"https://www.youtube.com/watch?v=9PObvIbB1Fg",
@guibeira
guibeira / config.yml
Last active July 24, 2020 14:06
My configuration for terminalizer
# Specify a command to be executed
# like `/bin/bash -l`, `ls`, or any other commands
# the default is bash for Linux
# or powershell.exe for Windows
command: zsh
# Specify the current working directory path
# the default is the current working directory path
cwd: null
@guibeira
guibeira / connect_db
Created November 2, 2019 17:46
easy way to connect to database using heroku name
#!/bin/bash
default_db="heroku config:get DATABASE_URL --app "
args=("$@")
DATABASE_URL=$($default_db ${args[0]})
PG_WEB="pgweb --url"
echo $(xdg-open http://localhost:8081/)
echo $($PG_WEB $DATABASE_URL)
@guibeira
guibeira / play.sh
Last active December 28, 2019 23:34
play youtube music on cli
#!/bin/bash
echo $(pip install --upgrade youtube-dl)
args=("$@")
echo $args
echo $(youtube-dl -f 251 ${args[0]} -o - | ffplay -nodisp -autoexit -i -)
@guibeira
guibeira / deploy_music.sh
Last active December 29, 2019 02:58
deploy music
#!/bin/bash
echo $(pip install --upgrade youtube-dl)
echo $(youtube-dl -f 251 https://www.youtube.com/watch?v=mjjkHg5FOhk -o - | ffplay -nodisp -autoexit -i -)
@guibeira
guibeira / dolar.sh
Created July 1, 2022 15:19
dolar hj cli
#!/usr/bin/env bash
curl -m 1 https://economia.awesomeapi.com.br/last/USD-BRL | jq -r '.USDBRL.bid' | awk '{print "BRL "$0}'
@guibeira
guibeira / .pre-commit-config.yaml
Last active June 5, 2023 14:25
Pre commit on work folders
repos:
- repo: https://github.com/jumanjihouse/pre-commit-hooks
rev: master
hooks:
- id: forbid-space-in-indent
types: [python]
@guibeira
guibeira / search_linkedin.js
Last active February 1, 2023 01:35
small script to search content in job description
const timer = ms => new Promise(res => setTimeout(res, ms))
async function search(content) {
// // adjust the zoom level
// get list of jobs
let has_jobs = true
while (has_jobs) {
let scrolling = 0
const pg_button = document.getElementsByClassName("artdeco-pagination__indicator selected")
const next = pg_button[0].nextElementSibling
const jobs = document.getElementsByClassName("job-card-list__entity-lockup")