Collection of Advent Calendars!
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
sub catch-control { | |
CONTROL { | |
die "Caught a CONTROL ({.gist})"; | |
} | |
die "forced exception"; | |
} | |
for 1 { | |
catch-control; |
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
# signal(SIGINT).tap: { | |
# note "Took { now - INIT now } seconds. $*THREAD"; | |
# } | |
my $interrupt = signal(SIGINT); | |
$interrupt.tap: -> $v { | |
note "[got interrupt $v]"; | |
} |
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
module Test::QuickCheck { | |
multi gen(Int) { 1000000.rand.Int } | |
our sub verify-one( &f, &predicate ) { | |
my @params = &f.signature.params.map: -> $p { | |
# say "Param: {$p.gist}"; | |
gen($p.type) | |
}; |
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
class Template | |
def initialize(&block) | |
@body = block | |
end | |
def method_missing(v) | |
@params[v] | |
end |
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 ruby | |
puts "I am the great ORACLE!!" | |
puts | |
puts "Ask me any question, if you dare!" | |
puts "BUT BEWARE!!!!" | |
puts | |
puts "You may not like the answer." | |
puts |
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
my @games = ( | |
(name => "Villanova", seed => 1), | |
(name => "MSM", seed => 16), | |
(name => "Wisconsin", seed => 8), | |
(name => "Virginia Tech", seed => 9), | |
(name => "UVA", seed => 5), | |
(name => "UNC Wilmington", seed => 12), | |
(name => "Florida", seed => 4), | |
(name => "ETSU", seed => 13), |
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
games = [ | |
{name: "Villanova", seed: 1}, | |
{name: "MSM", seed: 16}, | |
{name: "Wisconsin", seed: 8}, | |
{name: "Virginia Tech", seed: 9}, | |
{name: "UVA", seed: 5}, | |
{name: "UNC Wilmington", seed: 12}, | |
{name: "Florida", seed: 4}, | |
{name: "ETSU", seed: 13}, |
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/sh | |
# Fill in your slack token (the bad way), and then this will | |
# set your status text/emoticon to the current hour of the day! | |
# | |
# After testing, put this in your contrab like: | |
# 0 * * * * /path/to/slack-clock.sh >/dev/null 2>&1 | |
token="..." |
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 | |
token="..." | |
while true ; do | |
for i in arrow_up arrow_upper_right arrow_right arrow_lower_right arrow_down arrow_lower_left arrow_left arrow_upper_left ; do | |
text="This%20way" | |
emoji="$i" | |
echo "$text: $emoji" | |
curl "https://slack.com/api/users.profile.set?token=$token&profile=%7B%20%22status_text%22%3A%20%22$text%22%2C%20%22status_emoji%22%3A%20%22%3A$emoji%3A%22%20%7D&pretty=1" |