This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- set as bigint | |
ALTER SEQUENCE transaction_id_seq AS BIGINT; | |
-- select sequences | |
SELECT * FROM information_schema.sequences ORDER BY sequence_name; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- copied from https://dataedo.com/kb/query/postgresql/list-of-tables-by-their-size | |
select schemaname as table_schema, | |
relname as table_name, | |
pg_size_pretty(pg_relation_size(relid)) as data_size | |
from pg_catalog.pg_statio_user_tables | |
order by pg_relation_size(relid) desc; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
hoteis = [ | |
{ | |
"nome" : "lakewood", | |
"classificacao" : 3, | |
"regular" : { | |
"dia_da_semana" : 110, | |
"fim_de_semana" : 90, | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Shuffle your playlist songs! | |
# This script uses Spotify's API endpoint for *replacing* all songs | |
# within your playlist. So after shuffling, your songs will appear with a new added date | |
# | |
# You need to pass part of your playlist's name and a valid token | |
# Generate token here: https://developer.spotify.com/console/put-playlist-tracks/ | |
# | |
# This script uses riffle shuffle 7 times | |
# https://stackoverflow.com/questions/19898138/how-can-we-riffle-shuffle-the-elements-of-a-list-in-python#19898430 | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Know how your meetup.com group is growing through events! | |
# Get your API token here: https://secure.meetup.com/pt-BR/meetup_api/key/ | |
# You don't need to install nothing! It's 100% pure python | |
# python meetup-insights.py <group-name> <your api token> | |
from urllib import request,parse | |
from functools import reduce | |
import datetime | |
import sys | |
import json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Não quero ter que exportar todo meu histórico das minhas contas bancárias | |
# e eu preciso controlar meu cartão a partir de certa data no Organizze | |
# então resolvi criar transações fake no Organizze, | |
# assim consigo controlar um pouco melhor meu cartão, | |
# sem ter que adicionar todo meu histórico novamente | |
# https://github.com/organizze/api-doc | |
import requests | |
API_BASE_URL = "https://api.organizze.com.br/rest/v2" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tr ' ' '\n' < LOG_FILE | grep WORD | wc -l |