Skip to content

Instantly share code, notes, and snippets.

Working from home

Juan Julián Merelo Guervós JJ

Working from home
Block or report user

Report or block JJ

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
JJ / Submitting Rmd to
Last active Oct 22, 2019
Submitting RMarkdown articles to Arxiv
View Submitting Rmd to

Mini-HowTo submit RMarkdown articles to ArXiV

ArXiV is a place for publishing scientific technical reports and drafts which is tightly tied to LaTeX. That is why if you generate a PDF from your RMarkdown article it will tell you, hey, this has been generated using LaTeX, I want the LaTeX source. In principle, RStudio does not admit LaTeX as a final format, only .doc, .pdf or HTML. But it is no big deal.

You only need to add this to the metadata in the RMarkdown document

    keep_tex: true
JJ /
Created Oct 28, 2014
Google Spreadsheet: extrae información de una hoja y la copia en otra
Esta función lee datos de una hoja de cálculo que contiene el nombre del proyecto y los dos URLs que buscamos: repo y web, en las columnas 1, 3 y 19 de la hoja de cálculo (respuestas a un formulario en Google Spreadsheet). Los escribe en tres columnas de otra hoja de cálculo, previo borrado de la misma
Funciona con Herramientas->Editor de secuencias de comandos. La primera vez que lo ejecutes sobre una hoja de cálculo tendrás que autorizarla. Aparte, hay que crear una segunda hoja de cálculo resumen y copiar el id para sustituir donde pone *unIdCualquiera*
El resultado de la ejecución está aquí:
function summarize_projects() {
var sheet = SpreadsheetApp.getActiveSheet();
var output_sheet = SpreadsheetApp.openById("unIdCualquiera")
JJ /
Last active Mar 18, 2019 — forked from daotoad/
Getting to Know Perl6 From the Command Line: An Article for the 2018 Perl6 Advent Calendar
1234,Bobby Smith
1235,Rosa Felix
1236,Ramesh Patil
1245,Virginia Ryder
1356,Snively Witherspoon
1358,Burnedette Down
1366,Evelyn Tent
JJ /
Created Dec 1, 2018
Advent Calendar Article (for formatting)

Like 6 Perls in a Pod: document everything

Christmas season was approaching, and Santa was in a gloomy mood. His inbox was full with letters from boys and girls coming from all over.


Were they letter to Santa? Was the kid properly identified by signature, so that you sent the gifts to the proper person and not someone else who might

JJ /
Created Nov 1, 2018
Compilation test for Mathx::Stat

Created this test file

use v6;
use Test;
use-ok 'Mathx::Stat::Probability';

Run with

perl6 -Ilib t/use.t
JJ /
Created Dec 23, 2016 — forked from massa/
Fibonacci sequence implementation in Perl6
my constant @fib = 1, 1, *+* ... *;
JJ /
Created Apr 12, 2018
Extract the tags from the perl6/doc POD6
# git clone perl6/doc, cd doc
git grep "=begin pod" | perl6 -e 'say slurp().split("\n").grep( /tag/ ).map( * ~~ / \<(.+)\> / ).map( *.values.[0] ).join("\n")'
# (「convert」 「convert」 「convert」 「convert」 「convert」 「self」 「tutorial」 「self」 「tutorial」 「perl6」 「self」 「perl6」 「perl6」 「perl6」 「perl6」 「index」 「perl6」 「list」 「tutorial」 「perl6」 「convert」 「perl6」 「perl6」 「perl6」 「perl6」 「perl6」 「tutorial」 「perl6」 「perl6」 「perl6」 「perl6」 「perl6」 「perl6」 「tutorial」 「perl6」 「perl6」 「index」 「perl6」 「convert」 「perl6」 「perl6」 「perl6」 「perl6」 「pod6」 「perl6」 「tutorial」 「index」 「perl6」 「perl6」 「index」 「tutorial」 「perl6」)
JJ / failing-c-channels.p6
Last active Mar 22, 2018
(Failing) concurrent channels in perl6
View failing-c-channels.p6
my Channel $c .= new;
my Channel $c2 = $c.Supply.batch( elems => 2).Channel;
my $count = 0;
$c.send($_) for ^40;
my $work = start react whenever $c -> $item {
$c.send( $item );
say "This is $item";
JJ / is-product.p6
Created Dec 2, 2017
Check whether an item in a list is a product
View is-product.p6
use v6;
use JSON::Tiny;
use Wikidata::API;
sub MAIN( Str $toy-list = 'list.json' ) {
my $toys = from-json $toy-list.IO.slurp();
say $toys.grep( { is-product( $^þ) } );
JJ / list.p6
Created Dec 2, 2017
Find items in a markdown list
View list.p6
use v6;
use Text::Markdown;
use JSON::Tiny;
sub MAIN( Str $letter-to-santa = 'letters/' ) {
my $letter =$letter-to-santa.IO.slurp());
my $flip = False;
my $list = $letter.items
.grep( { $flip = ( $flip
You can’t perform that action at this time.