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 / hola.yaml
Created December 3, 2019 18:53
Raku advent calendar 2019 gists
name: "Merry Christmas"
on: [push]
jobs:
seasonal_greetings:
runs_on: ubuntu-latest
steps:
- name: Merry Xmas!
run: echo Merry Xmas!
@JJ
JJ / using-steps.yaml
Last active December 5, 2019 17:14
Gist for the Raku Advent Calendar: using step results in GitHub actions
name: "One step up"
on: [push]
jobs:
seasonal_greetings:
runs-on: ubuntu-latest
steps:
- name: Pre-Merry Xmas!
env:
greeting: "Merry"
@JJ
JJ / windows-perl-comment-github-action.yml
Created December 5, 2019 15:27
GitHub action that uses Perl in Windows with Powershell. This creates a comment when certain words are mentioned in an issue.
name: "We 馃帞 Perl"
on:
issues:
types: [opened, edited, milestoned]
jobs:
seasonal_greetings:
runs-on: windows-latest
steps:
- name: Checkout
@JJ
JJ / raku-github-action-CI.yaml
Created December 5, 2019 15:31
GitHub action for continuous integration using the Raku container.
name: "We 馃帞 Ubuntu, Docker and Raku"
on: [push, pull_request]
jobs:
adventest:
runs-on: ubuntu-latest
name: AdvenTest
steps:
- name: Checkout
uses: actions/checkout@v1
@JJ
JJ / 00-regex.p6
Created December 5, 2019 15:32
Simple Raku test using the Test library
#!/usr/bin/env perl6
use v6;
use Test;
constant $greeting = "Merry Xmas!";
constant $non-greeting = "Hey!";
is( greet( "Hey", $greeting, $non-greeting), $non-greeting, "Non-seasonal salutation OK");
is( greet( "Merry Xmas!", $greeting, $non-greeting), $greeting, "Seasonal salutation OK");
done-testing;
@JJ
JJ / raku-test.Dockerfile
Created December 5, 2019 15:35
Raku Dockerfile for Container Action
FROM jjmerelo/alpine-perl6:latest
LABEL version="4.0.2" maintainer="JJ Merelo <[email protected]>"
# Set up dirs
ENV PATH="/root/.rakudobrew/versions/moar-2019.11/install/bin:/root/.rakudobrew/versions/moar-2019.11/install/share/perl6/site/bin:/root/.rakudobrew/bin:${PATH}"
RUN mkdir /test
VOLUME /test
WORKDIR /test
@JJ
JJ / rakudo-star-github-action.yml
Created December 5, 2019 15:40
Installing Rakudo Star in a GitHub Action
name: "We 馃帞 Raku"
on: [push, pull_request]
jobs:
test:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v2-beta
- name: Install and update
@JJ
JJ / PAS-UGR-Linux.md
Last active March 16, 2020 15:59
Conexi贸n PAS UGR desde Linux

La seguridad es lo primero

Recuerda que tienes que tratar el ordenador con el que est茅s trabajando con ficheros de la UGR como si fuera tu ordenador de la propia UGR. No trabajes nunca en un usuario compartido, usa tu propio usuario y no compartas la contrase帽a. Los ficheros especialmente sensibles deber谩n estar protegidos contra lectura de cualquier otro usuario. Cierra tu escritorio siempre que te ausentes.

Ahora, a trabajar en Linux.

Aparentemente, la UGR no ha considerado necesario dar instrucciones para que el PAS se conecte al escritorio remoto desde Linux, s贸lo para sistemas operativos privativos. Adem谩s, se usa un programa privativo, s贸lo para Windows y con licencias restrictivas, que hace que la 煤nica forma de usarlo sea mediante escritorio remoto a un ordenador en la UGR.

A ver si esto sirve de lecci贸n para las universidades. Aunque lo dudo.

@JJ
JJ / threaded-primes.p6
Created July 31, 2020 15:57
Using threads to compute primes in an interval
#!/usr/bin/env raku
constant $interval = 100000;
my @threads = (^10).map: -> $i {
Thread.start(
name => "Checking primes from {$i * $interval } to { ($i+1)*$interval}",
sub {
for ($i * $interval)..^(($i+1)*$interval) -> $n {
next if ( $n %% 2 ) | ( $n %% 3 ) | ($n %% 5 );
@JJ
JJ / gist:e4ef3ed2dc31bdbfe2275998fc148b96
Last active May 8, 2021 04:07
List of Perl modules installed in the Docker Hub hook runner

List of Perl modules

It's been obtained by running cpan -l on the Docker Hub runner

Module Version
Algorithm::Diff 1.1903
Algorithm::Diff::XS 0.04
Algorithm::DiffOld 1.1
Algorithm::Merge 0.08