Skip to content

Instantly share code, notes, and snippets.

;; * TODO receber salário no quinto dia útil do mês
;; DEADLINE: <%%(nth-weekday-of-month-p date 5)>
;;
;; requer configuração das variáveis calendar-holidays ou holiday-*
(defun nth-weekday-of-month-p (date &optional n)
"Check if DATE is the Nth weekday of current month."
(or n (setq n 1))
(let* ((month (calendar-extract-month date))
(year (calendar-extract-year date))
@edenc
edenc / nutricao.org
Last active February 12, 2021 23:48
Acompanhamento Nutricional utilizando org-mode

introdução

Essas tabelas tem como objetivo calcular a ingestão diária de nutrientes para dietas controladas. Elas permitem o acompanhamento minucioso. Importante para atletas e regimes alimentares.

A estratégia consiste em calcular o quociente alimentar por grama, de cada propriedade nutriente do alimento e depois multiplicar esse quociente por cada produto numa tabela de acompanhamento diário.

Leite FortificadoDensidade
Quantidade250
^quant
#Valor Energético (kcal)1265.040000000
^ve
#Carboidratos (g)100.400000000
;; Added by Package.el. This must come before configurations of
;; installed packages. Don't delete this line. If you don't want it,
;; just comment it out by adding a semicolon to the start of the line.
;; You may delete these explanatory comments.
(package-initialize)
(require 'package)
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
(defun org-remote-link ()
(interactive)
(let ((target (org-refile-get-location)))
(org-with-wide-buffer
(save-excursion
(goto-char (nth 3 target))
(org-store-link 0))))
(org-insert-link))
package Number::Phone::BR;
use Moo;
my $new = __PACKAGE__->can('new');
extends 'Number::Phone';
sub new { shift->$new(@_) }
1;
qsort1 :: Ord a => [a] -> [a]
qsort1 [] = []
qsort1 (p:xs) = qsort1 lesser ++ [p] ++ qsort1 greater
where
lesser = filter (< p) xs
greater = filter (>= p) xs
use warnings;
use strict;
use Plack::Builder;
builder {
enable_if { $_[0]->{PATH_INFO} !~ m|^/static| } 'AccessLog';
sub {
return [200, ['Content-Type' => 'text/plain'], ['Hello World']]
}
use warnings;
use strict;
$^I = '';
my %count;
my @chars = qw(B);
while(<>) {
for my $char (@chars) {
my @count = /($char)/g;
$count{$char} += @count;
sub render_template {
my ( $self, $app ) = @_;
sub {
my ($env) = @_;
my $res = $app->($env);
return $res unless ref( $res->[2] ) eq 'ARRAY';
my $content = $res->[2][0];
my $vars = $env->{'pendant.doc'} || {};
my $rendered;
my $tt = $self->_tt;