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
/** | |
* Parte do Projeto LUX, em desenvolvimento desde 12 de novembro de 2016. | |
* | |
* Contém implementação do "Cálculo da Páscoa" pelo método tabular para | |
* datas no calendário Gregoriano, descrito em "Computus": | |
* | |
* https://en.wikipedia.org/wiki/Computus#Gregorian_calendar | |
* | |
* com adequações para o SQLite 3.7.13 ou mais recente, privilegiando o | |
* uso de datas no padrão ISO-8601. |
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
<?php | |
/** | |
* Extensão da classe PDO para SQLite, provendo "workaround" para | |
* bug no método de criação de funções em algumas versões de PHP | |
* e métodos de conveniência da extinta classe SQLite3. | |
* Exemplo de uso: | |
* try { | |
* $pdo = new SQLitePDO(); | |
* $pdo.connect("path_to/db.sqlite"); | |
* } catch(PDOException $e) { |
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
/** | |
* Usa jQuery.scrollTo em: https://github.com/flesler/jquery.scrollTo | |
*/ | |
/** | |
* Script para rolagem suave da window via plugin jQuery.scrollTo, | |
* parametrizada arbitrariamente e sob controle do usuário final. | |
*/ | |
$(document).ready(function WINDOW_SCROLLER() { |
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
/** | |
* Gestor de persistência de folhas de estilo temáticas. | |
*/ | |
function StyleSwitcher() { | |
var self = this; | |
var links = $("link[rel$='stylesheet'][title]").toArray().map($); | |
function search(callback) { |
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
with separators as ( values (' '), (','), ('-'), ('.') ), | |
source (s) as ( select " Will, thought and action." ), | |
bag (q) as ( -- POSITIONS OF ALL SEPARATORS | |
with dim (len) as ( select length(s) from source ), | |
ndx (n) as ( | |
select 1 union all select n+1 from ndx, dim where n < len | |
) select 0 --> PSEUDO SEPARATOR IN FRONT OF SOURCE STRING | |
union all select n from ndx, source where substr(s, n, 1) in separators | |
union all select len+1 from dim --> PSEUDO SEPARATOR AT BOTTOM | |
), |
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
pragma foreign_keys=off; | |
drop table if exists vertices; | |
drop table if exists arestas; | |
drop table if exists restricoes; | |
drop view if exists std; | |
drop view if exists search; | |
drop view if exists shortest_path; | |
drop view if exists path; |
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/Rscript --no-init-file | |
# Vaccine Infection Prevention Efficacy | |
# | |
# Eficácia da vacina na prevenção de infecção no contato com vacinados. | |
# | |
# Extraído do artigo "Estimating the probability that a vaccinated person still | |
# infects others with Covid-19" de 19/01/2021, disponível no R-blogger. | |
# |
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
#!/bin/bash | |
# | |
# Script para atualizar e (re)criar, se necessário, o db da Lotomania com dados | |
# baixados do website da Caixa Econômica Federal Loterias. | |
# formata indiferentemente ao separador de campos, data no formato | |
# yyyy.mm.dd ou dd.mm.yyyy como data no formato yyyy-mm-dd | |
full_date() { | |
# padroniza os separadores de campos | |
local d=${1//[^0-9]/-} |