Skip to content

Instantly share code, notes, and snippets.

View tcurvelo's full-sized avatar
🏠

Thiago Curvelo tcurvelo

🏠
View GitHub Profile
@tcurvelo
tcurvelo / homologacao.js
Last active February 19, 2017 04:55
Inclui faixa de 'versão de homologacao'
document.addEventListener("DOMContentLoaded", function(event) {
const faixa = document.createElement('div');
const estilo = document.createElement('style');
faixa.id='faixa-homologacao';
faixa.textContent = 'Versão de Homologação';
estilo.textContent = `
#${faixa.id} {
margin: 0;
@tcurvelo
tcurvelo / all_crontabs.sh
Created July 18, 2017 19:00
Get all contrabs jobs
for user in $(getent passwd | cut -f1 -d: ); do
crontab -u $user -l && echo $user && printf '=%.0s' {1..100} && echo ;
done 2> /dev/null
@tcurvelo
tcurvelo / xmlsplit.py
Created September 3, 2017 01:19
Cli utility for spliting a big XML file into smaller parts.
#!/usr/bin/env python3
"""
Cli utility for spliting a big XML file into smaller parts.
The breakpoint will be the element of depth 1 (below root) that does not
fit in the specified maximum size. Each part created will have the same
root element.
Usage:
$ xmsplit size prefix [filename]
@tcurvelo
tcurvelo / takeout.js
Created April 18, 2018 00:46
WIP: Automating Google Takeout Download
const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch({headless: false});
const page = await browser.newPage();
await page.goto('https://takeout.google.com/');
const input = await page.evaluate(() => {
const next = document.querySelector('#identifierNext');
# -*- coding: utf-8 -*-
from datetime import date
from urllib.parse import urlencode
import scrapy
class TjpbSpider(scrapy.Spider):
name = "tjpb"
allowed_domains = ["juris.tjpb.jus.br"]
@tcurvelo
tcurvelo / jupyter_splash.sh
Created September 19, 2020 21:30
Run container with Splash, Jupyter and GUI support
#!/bin/bash
xhost +local:docker
docker run \
-e DISPLAY=unix$DISPLAY \
-v /tmp/.X11-unix:/tmp/.X11-unix \
-v $XAUTHORITY:$XAUTHORITY \
-v $(pwd)/notebooks:/notebooks \
-e XAUTHORITY=$XAUTHORITY \
-p 8888:8888 \