Skip to content

Instantly share code, notes, and snippets.

View jonathanstowe's full-sized avatar

Jonathan Stowe jonathanstowe

View GitHub Profile
#!/usr/bin/env raku
sub postfix:<!>( Int $n ) { [*] (1..$n) }
sub prefix:<Σ>( *@nums ) { [+] @nums }
sub compute_this (Int $n) {
Σ (0..$n).map(
-> $r {
$n! / ($r! * ($n - $r)!)
}
unit class SnakeAndLadders;
has @.board =
1, 38, 3, 4, 5, 6, 14, 31, 9, 10,
11, 12, 13, 14, 26, 6, 17, 18, 19, 20,
42, 22, 23, 24, 25, 26, 27, 84, 29, 30,
31, 32, 33, 34, 35, 44, 37, 38, 39, 40,
41, 42, 43, 44, 45, 25, 47, 48, 11, 50,
67, 52, 53, 54, 55, 56, 57, 58, 59, 60,
61, 19, 63, 60, 65, 66, 67, 68, 69, 70,
91, 72, 73, 53, 75, 76, 77, 98, 79, 80,

Starting to play with packer and vagrant

The bottom line is I want Packer to build Centos 7 boxes from scratch and configure and use them thanks to Vagrant as a throwaway Hadoop cluster for dev. I want all of this to (ultimately) not rely on the network so I have full control of what goes in, and I can do this when offline. There is still a long way to go to that end, but here are the first steps. We don't want to depend on images downloaded from the Internet but only on the original ISO from Centos, and the Cloudera rpms.

#!/usr/bin/env perl6
use LWP::Simple;
sub MAIN ($gist-url) {
put LWP::Simple.get($gist-url)
.comb(/'<article' <-[>]>+ '>' <(.+?)> '</article>'/)
.subst(:g, 'class="pl-c"', 'style="color: #999;"')
.subst(:g, 'class="pl-c1"', 'style="color: #449;"')
.subst(:g, 'class="pl-k"', 'style="color: blue;"')
.subst(:g, 'class="pl-pds"', 'style="font-weight: bold;"')
#!perl6
use v6.c;
use Audio::PortMIDI;
class Mode {
my %modes = ionian => [0,2,4,5,7,9,11,12],
dorian => [0,2,3,5,7,9,10,12],
phrygian => [0,1,3,5,7,8,10,12],
lydian => [0,2,4,6,7,9,11,12],
@herzi
herzi / spec.md
Last active August 29, 2015 14:09 — forked from ePirat/spec.md

Icecast protocol specification

What is the Icecast protocol?

When speaking of the Icecast protocol here, actually it's just the HTTP protocol, and this document will explain further how source clients need to send data to Icecast.

HTTP PUT based protocol

Since Icecast version 2.4.0 there is support for the standard HTTP PUT method. The mountpoint to which to send the data is specified by the URL path.

@ePirat
ePirat / spec.md
Last active May 5, 2024 11:56
Icecast Protocol specification

Icecast protocol specification

What is the Icecast protocol?

When speaking of the Icecast protocol here, actually it's just the HTTP protocol, and this document will explain further how source clients need to send data to Icecast.

HTTP PUT based protocol

Since Icecast version 2.4.0 there is support for the standard HTTP PUT method. The mountpoint to which to send the data is specified by the URL path.