Skip to content

Instantly share code, notes, and snippets.

View awwaiid's full-sized avatar

Brock Wilcox awwaiid

View GitHub Profile
sub catch-control {
CONTROL {
die "Caught a CONTROL ({.gist})";
}
die "forced exception";
}
for 1 {
catch-control;
# signal(SIGINT).tap: {
# note "Took { now - INIT now } seconds. $*THREAD";
# }
my $interrupt = signal(SIGINT);
$interrupt.tap: -> $v {
note "[got interrupt $v]";
}
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)
};
class Template
def initialize(&block)
@body = block
end
def method_missing(v)
@params[v]
end
#!/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
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),
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},
#!/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="..."
#!/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"