This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
# s3sync: 1-way synchronization of your files with S3 storage with auto minify *.css and *.js files and gzip text/* content | |
use Modern::Perl; | |
use Amazon::S3; | |
use Path::Class (); | |
use IO::Compress::Gzip qw(gzip $GzipError); | |
use File::MMagic; | |
use JavaScript::Minifier::XS; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sub wrap { | |
my ($self, $data) = @_; | |
return $self->engine->process($self->path.'/layout.html', { | |
'//head' => { | |
'title' => $data->{title}, | |
'./script[last()-1]' => @{$data->{js}}?[map { './@src' => '/js/'.$_.'.js' }, @{$data->{js}}]:undef, | |
'./link[last()]' => @{$data->{js}}?[map { './@href' => '/css/'.$_.'.css'}, @{$data->{css}}]:undef, | |
'./script[last()]' => $data->{jscode}?sub { $_ =~ s/\/\*code\*\//$data->{jscode}/; \$_ }:undef, | |
}, | |
'//body' => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<script type="application/x-javascript"> | |
WEB_SOCKET_SWF_LOCATION = 'WebSocketMain.swf'; | |
</script> | |
<script src="socket.io.min.js"></script> | |
<script src="//yandex.st/prototype/1.7.0.0/prototype.min.js"></script> | |
<script type="application/x-javascript"> | |
Event.observe(document, 'dom:loaded', function (){ | |
var socket = new io.Socket(window.location.hostname, { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Use of uninitialized value in substitution (s///) at /home/f2r/perl5/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/PocketIO/Message.pm line 55. | |
Use of uninitialized value in string eq at /home/f2r/perl5/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/PocketIO/Message.pm line 66. | |
Use of uninitialized value in string eq at /home/f2r/perl5/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/PocketIO/Message.pm line 66. | |
Use of uninitialized value in hash element at /home/f2r/perl5/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/PocketIO/Message.pm line 87. | |
Use of uninitialized value in string eq at /home/f2r/perl5/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/PocketIO/Message.pm line 90. | |
Use of uninitialized value in string eq at /home/f2r/perl5/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/PocketIO/Message.pm line 93. | |
Use of uninitialized value in string eq at /home/f2r/perl5/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/PocketIO/Message.pm line 93. | |
Use of uninitialized value in string eq at /home/f2r/perl5/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#perl | |
use v5.12; | |
use CDF; | |
use Data::Dumper qw(Dumper); | |
my ($id, @out); | |
CDF::CDFopen($ARGV[0], \$id); | |
CDF::CDFinquire($id, refstd([( undef, [], (undef) x 5 )])); pout(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#perl | |
use strict; | |
use warnings; | |
use feature 'say'; | |
use CDF; | |
use PDL; | |
use Data::Dumper 'Dumper'; | |
my ($id, @out); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use v5.14; | |
use OpenGL qw(:all); | |
use PDL; | |
use Time::HiRes qw(gettimeofday tv_interval); | |
my $o1 = OpenGL::Array->new_list(GL_FLOAT, map $_/40, (1..400)); | |
my $o2 = OpenGL::Array->new_list(GL_FLOAT, map $_/40, (1..400)); | |
my $p1 = pdl(float, map $_/40, (1..400))->reshape(20,20); | |
my $p2 = pdl(float, map $_/40, (1..400))->reshape(20,20); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/env perl | |
use v5.12; | |
use HTTP::Tiny(); | |
use JSON::XS(); | |
use Try::Tiny; | |
use HTML::Entities 'decode_entities'; | |
my @search_words = ('#supercollider', '#sc140', '#sc', qw( | |
Ndef Tdef Pbind SinOsc PMOsc LFSaw LFPulse Splay Pan2 LFNoise0 LFNoise1 LFNoise2 LFCub LFPar | |
LFTri Drand Ringz Dshuf Decay2 DelayN DelayL DelayC CombC GVerb FreeVerb VarSaw DynKlank DynKlang |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# some handy modules to print things | |
use Data::Dump 'dd'; | |
use DDP colored => 1, filters => { -external => [ 'PDL' ] }; | |
dd my $h = bless { a => 1 }, 'test'; | |
p $h | |
# ok - lets test scoping | |
say my $v = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# example usage: xvfb-run -a -s '-screen 0, 34x34x24' perl pdfshot.pl OUTFILE URL [ WAIT] | |
use v5.16; | |
use Gtk3 -init; | |
use Gtk3::WebKit; | |
(my $view = Gtk3::WebKit::WebView->new)->set_transparent(Glib::FALSE); | |
(my $window = Gtk3::OffscreenWindow->new)->add($view); | |
$view->signal_connect('notify::load-status' => sub { if ($view->get_uri && $view->get_load_status eq 'finished') { | |
Glib::Timeout->add( $ARGV[2] // 5, sub { | |
$view->get_main_frame->print_full((map { |
OlderNewer