Skip to content

Instantly share code, notes, and snippets.

View zpmorgan's full-sized avatar

Zach Morgan zpmorgan

View GitHub Profile
@zpmorgan
zpmorgan / filetypes.perl
Created March 4, 2009 06:45
geany color scheme for perl
# For complete documentation of this file, please see Geany's main documentation
[styling]
# foreground;background;bold;italic
default=0x000000;0xf3f7f0;false;false
error=0xff0000;0xf3f7f0;false;false
commentline=0x575757;0xf3f7f0;false;false
number=0x524a24;0xf3f7f0;true;false
word=0x000000;0xf3f7f0;true;false
string=0xff0000;0xf3f7f0;false;false
character=0xcf0000;0xf3f7f0;false;false
DBIx::Class::ResultSet::all(): DBI Exception: DBD::SQLite::db prepare_cached failed:
ambiguous column name: ruleset.phase_description [for Statement "
SELECT me.entity as entity, phase, game.id as gid, ruleset.phase_description as pd
FROM Player_to_game me
JOIN Game game ON game.id = me.gid
JOIN Ruleset ruleset ON ruleset.id = game.ruleset
LEFT JOIN Player_to_game player_to_game ON player_to_game.gid = game.id
LEFT JOIN Player_to_game player_to_game_2 ON player_to_game_2.gid = game.id
JOIN Ruleset ruleset ON ruleset.id = game.ruleset
@zpmorgan
zpmorgan / examine_av.pl
Created January 14, 2012 21:25
gstreamer audio & video buffers;
#!/usr/bin/perl
use Modern::Perl;
use Glib qw/TRUE FALSE /;
use GStreamer qw/-init GST_TIME_FORMAT GST_SECOND/;
my $filename = shift @ARGV;
die 'nofile' unless $filename;
use Cwd 'abs_path';
$filename = abs_path $filename;
@zpmorgan
zpmorgan / build.log
Created January 20, 2012 14:36
pdl doc build fail
...
FITS.pm... 6 functions
Pic.pm... 7 functions
Misc.pm... 11 functions
Dumper.pm... 9 functions
FastRaw.pm... 4 functions
NDF.pm... 3 functions
found 1155 functions
@zpmorgan
zpmorgan / piddlebot.pl
Created January 22, 2012 19:58 — forked from run4flat/piddlebot.pl
opkick: IRC bot to kick people who give it ops.
#!/usr/bin/perl
use warnings;
use strict;
use POE;
use POE::Component::IRC::State;
use constant CHANNEL => '#pdl';
# Load the current piddlebot functions:
use piddlebot;
my $last_modified = (stat('piddlebot.pm'))[9];
@zpmorgan
zpmorgan / encode-pngs-theora.sh
Created February 10, 2012 09:12
gst-launch -- take a bunch of png files, flip them vertically, and stuff them into a theora file.
#!/bin/bash
rm -r /tmp/frames
mkdir /tmp/frames
ln /home/zach/projects/Desulfurize/screenshots/*png /tmp/frames/
COUNTER=0
for FILE in `ls /tmp/frames`; do
mv /tmp/frames/$FILE /tmp/frames/`printf "%04d" $COUNTER`.png
COUNTER=$(($COUNTER+1))
done
@zpmorgan
zpmorgan / gist:2467441
Created April 22, 2012 23:06
terasology fail?
zach@zach-foo:~/codestuff/Terasology$ ./gradlew run
:extractLinuxNatives UP-TO-DATE
:extractMacOSXNatives UP-TO-DATE
:extractWindowsNatives UP-TO-DATE
:extractNatives UP-TO-DATE
:compileJava UP-TO-DATE
:compileGroovy UP-TO-DATE
:processResources UP-TO-DATE
:classes UP-TO-DATE
:jar UP-TO-DATE
@zpmorgan
zpmorgan / dpend.pl
Created July 23, 2012 12:43
double pendulum simulation in box2d & sdl spewed to gst-launch with videoparse
# This example uses b2DistanceJoint to simulate a pendulum.
use strict;
use warnings;
use Box2D;
use SDL;
use SDL::Event;
use SDL::Video;
use SDLx::App;
my $gst_handle;
@zpmorgan
zpmorgan / pdlfail.pl
Created August 3, 2012 05:33
pdl fail regarding inplace assignment & lazy evaluation?
#!/usr/bin/env perl
use warnings;
use strict;
use PDL;
my $a = ones(2,2);
$a->inplace->minus($a*2,0);
print $a;
my $b = ones(2,2);
@zpmorgan
zpmorgan / myapp.pl
Created August 23, 2012 03:29
mojo url fail?
#!/usr/bin/env perl
use Mojolicious::Lite;
# Documentation browser under "/perldoc"
plugin 'PODRenderer';
get '/' => sub {
my $self = shift;
$self->render('index', url => $self->req->url);
};