Skip to content

Instantly share code, notes, and snippets.

View tene's full-sized avatar

Stephen Weeks tene

  • Sunnyvale, CA
View GitHub Profile
#!/usr/bin/perl6
use Net::SNMP;
my $session = Net::SNMP->session(:hostname<serenity>, :community<public>);
die("No session!") unless $session;
my $ifDescr = "1.3.6.1.2.1.2.2.1.2.1";
my $ifInOctets = "1.3.6.1.2.1.2.2.1.10.1";
macro my-if($/)
is parsed(
rule {
<cond=EXPR> <iftrue=block>
['else' <iffalse=block>]?
} ) {
quasi {
{{{$<cond>.ast}}}
?? {{{$<iftrue>.ast}}}
!! {{{$<iffalse>.ast}}}
@tene
tene / curses.pl
Created July 17, 2011 00:08 — forked from djanatyn/curses.pl
roguelike
#!/usr/bin/perl -w
# Use Moose for the Player class, and other slight improvements.
package Player;
use v5.10;
use strict;
use Moose;
has 'health' => (is => 'rw', isa => 'Int', default => 100);
has 'x' => (is => 'rw', isa => 'Int');
has 'y' => (is => 'rw', isa => 'Int');
@tene
tene / returnvalues.pl
Created July 18, 2011 02:53 — forked from djanatyn/returnvalues.pl
I can't believe this worked.
#!/usr/bin/perl
use v5.10;
use IO::File qw//;
sub countItems {
(my $target) = @_;
my $fh = IO::File->new('.ptd', 'r') or die 'no .ptd file found';
return map { /^$target:(.*)/ } <$fh>;
}
sub printTodo {
WHAT THIS IS
------------
The DELL LATITUDE E7440's docking station supports two external displays, and
the notebook's Haswell architecture supports having three displays active at
the same time. It works well, but the two external monitors are merged into one
big display:
$ xrandr
Screen 0: minimum 320 x 200, current 5280 x 1080, maximum 32767 x 32767
eDP1 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 309mm x 174mm