This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use v6.d.PREVIEW; | |
| # copied from https://github.com/FROGGS/p6-Ser/blob/master/lib/Ser.pm | |
| sub serialize($obj is copy) { | |
| use MONKEY-GUTS; | |
| my Mu $sh := nqp::list_s(); | |
| my $name = 'Ser_' ~ nqp::time_n(); | |
| my Mu $sc := nqp::createsc(nqp::unbox_s($name)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CFLAGS=-std=c99 | |
| use-it: use-it.o symbol.o | |
| symbol.o: symbol.c symbol.h | |
| use-it.o: use-it.c symbol.h |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # git find-ref $committish | |
| # | |
| # figure out which remote a committish comes from, and open its | |
| # corresponding web view in a browser | |
| # | |
| # NOTE: doesn't work with tag names, I'm not sure if it's possible to | |
| # know where a tag comes from |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use v6; | |
| use experimental :macros; | |
| macro splat-supply($b) { quasi { with {{{$b}}} { .tap:{ emit $_ }; .wait } } } | |
| sub x { supply { emit 2; emit 3 } } | |
| sub y { supply { emit 1; splat-supply x(); emit 4 } } | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (defun dakkar/perl-indent (beg end) | |
| (interactive "r") | |
| (if (use-region-p) | |
| (cond ((get-text-property beg 'in-pod) | |
| (let* ( | |
| (text (buffer-substring beg end)) | |
| (indented-text (with-temp-buffer | |
| (insert text) | |
| (cperl-mode) | |
| (cperl-indent-region 0 (buffer-size)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (require 'vagrant-tramp) | |
| (defun dakkar-cache-vagrant (orig &rest args) | |
| (let ((repo (pcache-repository "vagrant-tramp")) | |
| (key 'all-boxes)) | |
| (if (pcache-has repo key) | |
| (pcache-get repo key) | |
| (let ((value (apply orig args))) | |
| (pcache-put repo key value 300) | |
| value)))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env perl | |
| use 5.024; | |
| use strict; | |
| use warnings; | |
| use experimental 'signatures'; | |
| package Foo { | |
| sub new($class,%attrs) { bless \%attrs,$class } | |
| sub thing($self,$value=return $self->{thing}) { $self->{thing} = $value } | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env perl | |
| use 5.024; | |
| use strict; | |
| use warnings; | |
| use experimental 'signatures'; | |
| use Astro::MoonPhase (); | |
| use DateTime; | |
| use DateTime::Event::Easter; | |
| # IFC = International Fixed Calendar |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| feeding a 18kb email message, I get: | |
| $ perl6 /tmp/p.p6 medium-sized-email-message.txt | |
| slurping 0.00634555 | |
| matching 1.1612016 | |
| parsing 0.02143336 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use v6.d; | |
| unit class Foo; | |
| has $.thing; |