Skip to content

Instantly share code, notes, and snippets.

View JJ's full-sized avatar
🏠
Working from home

Juan Julián Merelo Guervós JJ

🏠
Working from home
View GitHub Profile
@JJ
JJ / perl-modules-github-actions-ubuntu-runner.md
Created January 8, 2021 07:14
List of Perl modules installed in the Github action runner

Here's the list of modules installed in the Ubuntu runner for Github actions. They've been obtained using a script that list all modules installed

Module
AnyDBM_File
App::Cpan
App::Prove::State::Result::Test
App::Prove::State::Result
App::Prove::State
App::Prove
@JJ
JJ / perl-modules-travis-ubuntu.md
Last active May 8, 2021 04:08
Perl modules installed in the Travis default runner
@JJ
JJ / adm.md
Last active September 26, 2021 16:39

Desde el punto de vista del estudiante (y también del profesor que viene más tarde) hay un tipo de asignaturas que vamos a denominar AdM (que evidentemente significa Asignaturas diseñadas Malamente) que tienen una serie de carencias, lo que causa una serie de actitudes en el estudiante. Vamos a tratar de caracterizar aquí estas diferencias

AdM Asignatura no-dM
En muchos casos, el contenido o el propio concepto de la asignatura no tiene nada que ver con la realidad laboral actual Hay un esfuerzo por estar al día de esa realidad laboral y usar siempre ejemplos y conceptos cercanos a la realidad conceptual y laboral
El que juzga si algo está bien o no es el profesor Los conceptos y si están bien o mal se pueden mirar en cualquier lado
En algunos casos, "lo que quiere el profe que escriba" está en contra de las buenas prácticas aprendidas en la práctica laboral Si hay alguna mala práctica o antipatrón, se puede solicitar una corrección y nunca resulta en mala nota
@JJ
JJ / text-char.raku
Last active December 18, 2021 19:26
Embedding Text::Chart code
unit module Text::Chart;
constant $default-char is export = "█";
sub vertical ( Int :$max = 10,
Str :$chart-chars = $default-char,
*@data ) is export {
my $space = " ";
my @chars = $chart-chars.comb;
@JJ
JJ / xmas-tree.raku
Created December 18, 2021 19:45
Painting a Xmas tree with Text::Chart
use Text::Chart;
my @data = < 1 2 3 4 5 6 7 6 5 4 3 2 1 >;
my $midway = (@data.elems/2).truncate;
my $max = max(@data);
my &left-pad = { " " x $midway ~ $_ ~ "\n"};
say left-pad("✶") ~ vertical( :$max, @data ) ~ left-pad("█") x 2;
@JJ
JJ / raku-test.yaml
Last active December 23, 2021 07:18
Github Action for testing Raku modules
name: "Test in a Raku container"
on: [ push, pull_request ]
jobs:
test:
runs-on: ubuntu-latest
permissions:
packages: read
container:
image: ghcr.io/jj/raku-zef-gha
steps:
@JJ
JJ / chart-files-changed.yaml
Created December 23, 2021 08:47
GitHub action step to chart the latest number of files changed in commits using Raku
- name: Install Text::Chart
run: zef install Text::Chart
- name: Chart files changed latest commits
shell: raku {0}
run: |
use Text::Chart;
my @changed-files = qx<git log --oneline --shortstat -$COMMITS>
.lines.grep( /file/ )
.map( * ~~ /$<files>=(\d+) \s+ file/ )
.map: +*<files>;
@JJ
JJ / raku-advent-2022-markdown-grammar.raku
Created November 25, 2022 14:06
Raku Advent 2022: Markdown Grammar by Tom Browder
# By Tom Browder https://github.com/tbrowder
use Markdown::Grammar:ver<0.4.0>;
my $markdown-doc = "poem.md";
my $pod-doc = "poem.rakudoc";
$pod-doc = from-markdown $markdown-doc, :to("pod");
@JJ
JJ / using-rakupod-object-by-tbrowder.raku
Created November 26, 2022 17:55
Using Rakupod Object
use Pod::Lite;
use Pod::To::PDF::Lite;
use RakupodObject;
my $pod-object = rakupod2object $pod-doc;
# pod2pdf $pod-object # args ...
@JJ
JJ / combine-pds.raku
Created November 26, 2022 17:57
Combine PDs by Tom Browder
use PDF::Lite;
use PDF::Font::Loader;
my @pdfs = <list of pdf files to combine>;
# create a new pdf to hold the entire collection
my $pdf = PDF::Lite.new;
$pdf.media-box = 'Letter';
my $centerx = 4.25*72; # horizontal center of the page
# the cover
my PDF::Lite::Page $page = $pdf.add-page;