This file contains hidden or 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
| package MooseX::Types::DuckType::Catalyst; | |
| use MooseX::Types -declare => [qw/ | |
| Request | |
| Response | |
| /]; | |
| use Try::Tiny qw/ try /; | |
| use Moose::Util::TypeConstraints; | |
| use MooseX::Types::Moose ':all'; | |
| use namespace::clean -except => [qw/ import unimport /]; |
This file contains hidden or 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
| #include <Ethernet.h> | |
| //#include <stomp.h> | |
| // network configuration. gateway and subnet are optional. | |
| byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED }; | |
| byte ip[] = { 172, 31, 24, 233 }; | |
| byte gateway[] = { 172, 31, 24, 1 }; | |
| byte subnet[] = { 255, 255, 255, 0 }; | |
| int ledPin = 7; // LED connected to digital pin 7 | |
| int state = 0; |
This file contains hidden or 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
| [% | |
| MACRO my_fmoney(amount,currency) | |
| BLOCK; | |
| IF currency == 'GBP'; | |
| fprefix = "£"; | |
| ELSIF currency == 'USD'; | |
| fprefix = "\$"; | |
| ELSIF currency == 'EUR'; | |
| fprefix = "€"; | |
| ELSE; |
This file contains hidden or 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
| DROP TABLE IF EXISTS dictionary; | |
| CREATE TABLE dictionary ( | |
| id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, | |
| name VARCHAR(50) UNIQUE NOT NULL | |
| ) ENGINE=InnoDB; | |
| DROP TABLE IF EXISTS dictionary_batch; | |
| CREATE TABLE dictionary_batch ( | |
| id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, | |
| dictionary_id INT UNSIGNED NOT NULL REFERENCES dictionary(id), |
This file contains hidden or 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
| - Test 1 or 2 more apps | |
| - write tests for getting default_model / default_view from config? | |
| - move block from sub controller to Catalyst::Utils | |
| - kill components class data | |
| - kill initialization in sub setup | |
| - kill duplication: http://paste.scsys.co.uk/123648 | |
| - create a sub components that returns all components | |
| - merge with around components => sub {} | |
| - locked hash (Hash::Util) | |
| - block inside sub setup: |
This file contains hidden or 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 | |
| use strict; | |
| use warnings; | |
| use Test::More; | |
| my $foo = chr(0xff); | |
| is(length($foo), 1, "character length of string is 1"); | |
| ok(!utf8::is_utf8($foo), "string not utf-8 upgraded"); |
This file contains hidden or 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
| package Shutterstock::Example::Nonblock; | |
| use Web::Simple; | |
| use Plack::App::File; | |
| use File::ShareDir::ProjectDistDir; | |
| use File::Spec::Functions; | |
| use Imager::Simple; | |
| sub share { our $share ||= dist_dir 'Shutterstock-Example-Nonblock' } |
This file contains hidden or 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
| This file documents the revision history for Perl extension TestFlood. | |
| 0.01 2012-04-13 08:45:03 | |
| - initial revision, generated by Catalyst |
This file contains hidden or 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
| function compress_simple(s) { | |
| var i=0, l, out=''; | |
| if (s.length % 2 !== 0) s += ' '; | |
| for (l = s.length; i < l; i+=2) { | |
| out += String.fromCharCode((s.charCodeAt(i)*256) + s.charCodeAt(i+1)); | |
| } | |
| return out; | |
| } | |
| function uncompress_simple(s) { |
This file contains hidden or 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
| package Plack::Middleware::FixFCGIPath; | |
| use strict; | |
| use warnings; | |
| use base qw/ Plack::Middleware /; | |
| sub call { | |
| my ($self, $env) = @_; | |
| if (length($env->{PATH_INFO})) { | |
| $env->{PATH_INFO} = '/' . $env->{PATH_INFO} |