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
@skids
skids / rolevolution.txt
Last active May 23, 2018 18:45
rakudo rolevolution branch
TLDR:
https://github.com/skids/rakudo/tree/rolevolution3
... is a spectest-passing branch of rakudo with:
A) Working diamond role composition
B) A solution to Ovid's complaint about role method overrides
...but the code needs a bit of work.

PLAYING CARDS


Here we have the code of the program. <((1,2,3,4,5,6,7,8,9,10,'J','Q','K') X ("♠","♥","♦","♣")).roll>

<((1,2,3,4,5,6,7,8,9,10,'J','Q','K') X ("♠","♥","♦","♣")).pick(52)>

<roll> is used for picking any card randomly.

@ElenaMerelo
ElenaMerelo / cards.md
Last active January 8, 2017 11:57
Deck of cards which can be shuffled

#Deck of cards First we pick a random card, then in the second line we shuffle the whole deck of cards, including the one chosen

((1,2,3,4,5,6,7,8,9,10,'j','q','k') X~ <♥,♦,♣,♠>).roll

((1,2,3,4,5,6,7,8,9,10,'j','q','k') X~ &lt;♥,♦,♣,♠&gt;).pick(52)
#!/usr/bin/env perl6
my Int $len = 16;
my $maxlen = 32768;
my $how-many =100000;
while $len < $maxlen {
my $start = now;
my int @ones[$len];
for 1..$how-many {
loop (my int $i = 0; $i < $len; $i++) {
@gwillem
gwillem / ansible-bootstrap-ubuntu-16.04.yml
Created June 16, 2016 21:59
Get Ansible to work on bare Ubuntu 16.04 without python 2.7
# Add this snippet to the top of your playbook.
# It will install python2 if missing (but checks first so no expensive repeated apt updates)
# [email protected]
- hosts: all
gather_facts: False
tasks:
- name: install python 2
raw: test -e /usr/bin/python || (apt -y update && apt install -y python-minimal)
@yowcow
yowcow / bin-dec-hex.p6
Last active May 3, 2018 09:38
Binary/Decimal/Hex in Perl 6
use v6;
# Hex => Dec
:16("ff").base(10); # 255
# Dec => Bin
:10("10").base(2); # 1010
# Bin => Hex
:2("1111").base(16); # F
@MattOates
MattOates / BioREPL
Last active January 12, 2017 13:22
New Rakudo REPL with slanged multiline quote constructor for arrays of bio-sequence objects. Example takes copy pasted FASTA formatted sequence data between ` ` and creates an array of sequence objects. Translated into amino acids we get the PERL peptide ;3 For the code that generates the slang please see https://github.com/MattOates/BioInfo/blo…
$ perl6 -MBioInfo
To exit type 'exit' or '^D'
> my @dna = `
* >id comment
* CCCGAACGGCTT
* `;
[>id comment
CCCGAACGGCTT
]
> @dna[0].translate
@LLFourn
LLFourn / provides.p6
Created February 23, 2016 03:26
create META6.json provides
use File::Find;
.say for find(dir => "lib", name => /\.pm6$/)».Str.map({"\"{.subst("lib/","").subst("\.pm6","").subst("/","::",:g)}\" : \"$_\","}
os: Visual Studio 2015
platform: x64
install:
- '"C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x64'
- choco install strawberryperl
- SET PATH=C:\strawberry\c\bin;C:\strawberry\perl\site\bin;C:\strawberry\perl\bin;%PATH%
- git clone https://github.com/rakudo/rakudo.git %APPVEYOR_BUILD_FOLDER%\..\rakudo
- cd %APPVEYOR_BUILD_FOLDER%\..\rakudo
@AlexDaniel
AlexDaniel / save-me-from-texas.creole
Last active March 14, 2017 01:01
Save me from Texas

⚠⚠⚠⚠⚠⚠⚠ ↓↓↓ PAGE MOVED ↓↓↓ ⚠⚠⚠⚠⚠⚠⚠

I moved this page to rakudo wiki. A lot of people wanted to add stuff, but gists are not editable. A wiki is a more appropriate place for this kind of stuff. Rakudo wiki is possibly not the best place for it, but for now that will do.

Plus, GitHub gists totally suck when unicode characters are involved. There's also no preview option here. So I'm glad that it is being moved.

⚠⚠⚠⚠⚠⚠⚠ ↑↑↑ PAGE MOVED ↑↑↑ ⚠⚠⚠⚠⚠⚠⚠

Recently Perl 6 got support for various unicode characters (½ ¹ ∞ × ÷, see this link for a full list), but I don't think that we are done. Here is a list of things to think about.