Skip to content

Instantly share code, notes, and snippets.

Brock Wilcox awwaiid

Block or report user

Report or block awwaiid

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View SDL+Coro
Err... see http://gist.github.com/327467 for the most up-to-date version
#!/usr/bin/perl
use strict;
use SDL;
use SDL::App;
use SDL::Game::Rect;
use SDL::Event;
use SDL::Events;
View coroSDL.pl
Err... see http://gist.github.com/327467 for the most up-to-date version
#!/usr/bin/perl
use strict;
use SDL;
use SDL::App;
use SDL::Game::Rect;
use SDL::Event;
use SDL::Events;
View coro_sdl.pl
#!/usr/bin/perl
use strict;
use SDL;
use SDL::App;
use SDL::Game::Rect;
use SDL::Event;
use SDL::Events;
use Coro;
View Twiggy Coro Test
# Boiled down to it's essentials? This is how to write a twiggy-compatible
# Coro-using PSGI app.
use strict;
use EV;
use Coro::AnyEvent;
use Coro;
my $app = sub {
View gist:913757
# Original API
my $grammar = Marpa::Grammar->new(
{ start => 'Expression',
actions => 'My_Actions',
default_action => 'first_arg',
rules => [
{ lhs => 'Expression', rhs => [qw/Term/] },
{ lhs => 'Term', rhs => [qw/Factor/] },
{ lhs => 'Factor', rhs => [qw/Number/] },
{ lhs => 'Term', rhs => [qw/Term Add Term/], action => 'do_add' },
@awwaiid
awwaiid / myboardgame.pl
Created Apr 25, 2011
Linux Format Perl Redone
View myboardgame.pl
#!/usr/bin/perl
use strict;
use Image::Magick;
# auxiliary variables
my $img_id = 0; #loop index
my @ordered_squares;
my $rotation = 180;
#Width and Height of each box, squares per side
@awwaiid
awwaiid / output.txt
Created Feb 13, 2012
Unit Testing Spim
View output.txt
$ prove -v unittest.t
unittest.t ..
ok 1 - expect_run
ok 2 - Load program
ok 3 - print $a0
ok 4 - $a0 starts out as 0
ok 5 - Stepping toward [main]
ok 6 - Initial jump to [main]
ok 7 - Stepping past [main]
ok 8 - print $a0
@awwaiid
awwaiid / 01 hive.rb
Last active Dec 24, 2015
Everyone adds a line, one at a time!
View 01 hive.rb
#!/usr/bin/env ruby
if ARGV == ['who', 'is', 'this?']
puts "THIS IS SPARTA!!!"
end
puts (words = File.read('/usr/share/dict/words')).length
good_words = words.split.select {|w| w.size > 6}
puts good_words.sample(3).join(' ')
Thread.new{ STDERR.<< ", \n A PLAY IN 3 PARTS.\n\n============ PAGE " }
puts good_words.length
puts File.read(__FILE__).split.detect{|_| _ =~ /SPARTA/}
View numswap_toggle
#!/usr/bin/perl
use strict;
use IO::Handle;
STDOUT->autoflush();
STDERR->autoflush();
print "1\n";
my $is_swapped = `xmodmap -pke | grep 'keycode 10 = exclam'`;
View blah.pl
use HOI::Match;
psub point_extract =>
"point (x _) :: r" => sub { my %args = @_; $args{x} + point_extract($args{r}) },
"nil" => sub { 0 };
point_extract(
[
{"type" => "point", "val" => [ 1, 2 ]},
{"type" => "point", "val" => [ 2, 4 ]},
You can’t perform that action at this time.