Skip to content

Instantly share code, notes, and snippets.

@rodrigorgs
rodrigorgs / convert-bb-card.html
Created November 13, 2024 00:01
Converte extrato de cartão do Banco do Brasil (PDF) para CSV
<html>
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdf-lib/1.17.1/pdf-lib.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdf.js/2.10.377/pdf.min.js"></script>
<script>
pdfjsLib.GlobalWorkerOptions.workerSrc = 'https://cdnjs.cloudflare.com/ajax/libs/pdf.js/2.10.377/pdf.worker.min.js';
async function convertPdfToCsv() {
const fileInput = document.getElementById('pdfUpload');
const output = document.getElementById('csvOutput');
@rodrigorgs
rodrigorgs / converte-picpay.html
Created November 1, 2024 20:45
Converte extrato do PicPay (PDF) para CSV
<html>
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdf-lib/1.17.1/pdf-lib.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdf.js/2.10.377/pdf.min.js"></script>
<script>
pdfjsLib.GlobalWorkerOptions.workerSrc = 'https://cdnjs.cloudflare.com/ajax/libs/pdf.js/2.10.377/pdf.worker.min.js';
async function convertPdfToCsv() {
const fileInput = document.getElementById('pdfUpload');
const output = document.getElementById('csvOutput');
# Converte um backup do DataCifra (arquivo .dtcxlist) em texto simples,
# em um formato que pode ser importado pelo Cifra+
#
import plistlib
import base64
import NSKeyedUnArchiver
import sys
import os
import unicodedata
import re
@rodrigorgs
rodrigorgs / highlight-ebook-clippings.py
Created January 5, 2022 11:22
Highlight clippings on an ebook
#!/usr/bin/env python3
# Highlight clippings on an ebook
# Input:
# - clippings file (generated by Calibre --
# see https://www.mobileread.com/forums/showthread.php?t=76069)
# - ebook in HTML format (exported by Calibre)
#
# Output:
# - HTML ebook with highlights in yellow
#!/usr/bin/env ruby
require 'github_api'
def die(msg)
STDERR.puts msg
STDERR.puts
exit 1
end

JavaScript (JS)

Estrutura

Crie um arquivo com extensão .html com o seguinte conteúdo e abra-o em um navegador.

<!DOCTYPE html>
<html>
<head>
@rodrigorgs
rodrigorgs / web_steps.rb
Last active November 12, 2016 10:55 — forked from wilkerlucio/webrat_steps_br.rb
cucumber pt-br websteps - não foi testado
# language: pt
# IMPORTANT: This file is generated by cucumber-rails - edit at your own peril.
# It is recommended to regenerate this file in the future when you upgrade to a
# newer version of cucumber-rails. Consider adding your own code to a new file
# instead of editing this one. Cucumber will automatically load all features/**/*.rb
# files.
require File.expand_path(File.join(File.dirname(__FILE__), "..", "support", "paths"))
@rodrigorgs
rodrigorgs / enumerate-refs2.rb
Last active October 18, 2016 17:25
Modifies an ODT file, replacing occurrences of [[id-label]] with sequential numbers (one sequence per id).
#!/usr/bin/env ruby
# enumerate-refs2.rb
# Author: Rodrigo Rocha <[email protected]>
# Date: 2016-10-18
# To install the dependency, run on terminal:
# gem install rubyzip
require 'zip'
class Referencer; end
@rodrigorgs
rodrigorgs / enumerate-refs.rb
Last active October 18, 2016 16:59
Modifies an ODT file, replacing occurrences of [[label]] with sequential numbers (one sequence per label)
#!/usr/bin/env ruby
# enumerate-refs.rb
# Author: Rodrigo Rocha <[email protected]>
# Date: 2016-10-18
# To install the dependency, run on terminal:
# gem install rubyzip
require 'zip'
class Referencer; end