Skip to content

Instantly share code, notes, and snippets.

View zpmorgan's full-sized avatar

Zach Morgan zpmorgan

View GitHub Profile
var game;
var puzzle;
var pointsArray = [];
var pointColors = ["0x00ff00", "0x008800", "0x880000", "0xff0000"];
var bezierGraphics;
var movingSprite;
requirejs(['domReady', 'phaser', 'puzzle'], function(domReady){
domReady(function() {
@zpmorgan
zpmorgan / rand-jig.pl
Last active August 5, 2016 08:11
random jigsaw puzzle launcher
#!/usr/bin/env perl
#./rand-jig.pl -p 200 -s 'imaginarylandscapes/top?sort=top&t=all'
use Modern::Perl;
use Mojo::UserAgent;
use Getopt::Long;
use Path::Tiny;
my $img_dir = "~/jig-images";
@zpmorgan
zpmorgan / convertmusic.sh
Last active December 20, 2015 07:59 — forked from strycore/setup.sh
cd "Wave Bank"
find . -name "*.wav" -exec ffmpeg -i {} -acodec pcm_u8 {}.conv.wav \;
#find . -name "*.m4a" -exec faad {} \;
#mmv -v -c "Wave Bank_0000*.xwma.m4a.wav.wma" "Music_#1"
#mmv -v -c "Wave Bank_0001*.xwma.m4a.wav.wma" "Music_1#1"
mmv -v -c "Wave Bank_0000*.wav.conv.wav" "Music_#1"
mmv -v -c "Wave Bank_0001*.wav.conv.wav" "Music_1#1"
0 0 8 13 8 9 8 12 8 11 0 0 0 0 0 0 0 0 0 0 0 0 0 500 100 0 1 1 0 -1 0 0 0 0 0 0 -1 -1 -1 0 0 0 -1 -1 -1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 5 0 0 0 0 0 0 0 0 0 0 0 0 -1208553032 -1073747112 -1211047759 -1207960972 -1073747056 0 -1208058151 -1211559136 -1073747088 1 -1209467208 0 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1
# SHELTER LAP x3 BENCHMARK
# go outside, run around the evac building 3 times, and go back inside.
# this will erase your save folder.
# not a script. just past it into your terminal.
# requires perf.
rm -r save
perf record -g ./cataclysm
jll
@zpmorgan
zpmorgan / Scorable.pm
Created October 14, 2012 18:02
go game scorable
package Basilisk::Scorable;
use Moose;
# Basilisk::Scorable,
# * original Basilisk had death masks & territory masks.
# * B::Scorable should encapsulate that,
# & have methods to derive score from caps, deads, & territory
has rulemap => (
isa => 'Basilisk::Rulemap',
#!/usr/bin/env perl
use warnings;use strict;
use Mojo::Redis;
our $pub_redis = Mojo::Redis->new();
$pub_redis->connect;
$pub_redis->timeout(1<<29);
__END__
Can't call method "timeout" on an undefined value at
@zpmorgan
zpmorgan / pubsub.pl
Created September 22, 2012 00:47
pub/sub with mojolicious, redis, & websockets.
#!/usr/bin/env perl
use Mojolicious::Lite;
use common::sense;
use Mojo::JSON;
my $json = Mojo::JSON->new();
use Mojo::Redis;
use Protocol::Redis::XS;
@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);
};
@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);