Skip to content

Instantly share code, notes, and snippets.

# 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 <rodrigo@dcc.ufba.br>
# 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 <rodrigo@dcc.ufba.br>
# Date: 2016-10-18
# To install the dependency, run on terminal:
# gem install rubyzip
require 'zip'
class Referencer; end
// Crie um arquivo HTML que importa a biblioteca Ramda
// <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/ramda/0.19.1/ramda.min.js"></script>
// Exercício 1
//==============
// Refatore o código para remover todos os argumentos através da aplicação parcial da função
var words = function(str) {
return R.split(' ', str);
};
  • 10 de março de 2016
  • Universidade Federal da Bahia
  • MATA60 - Banco de Dados
  • Prof. Rodrigo Rocha

Roteiro: índices

  1. Abra um terminal, execute o python e cole o seguinte código: