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 Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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 ojo; | |
my $s = oO( q{http://} | |
. join(q{:}, @ARGV) | |
. q{@api.twitter.com/1/statuses/friends_timeline.json} | |
)->json; | |
foreach (@$s) { | |
print Oo($_->{user}{screen_name}, q{: }, $_->{text}); | |
my @links = | |
map { $_ =~ s/\.$//; $_ } |
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/env perl | |
use strict; | |
use warnings; | |
use Mojo::JSON; | |
my $str = qq{[ | |
{ | |
"text" : " |
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/env perl | |
use warnings; | |
use strict; | |
use Test::More; | |
use Test::Mojo; | |
use Mojolicious::Lite; | |
post '/foo' => sub { | |
my $self = shift; |
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/env perl | |
use warnings; | |
use strict; | |
# Mojo::Loader executes arbitray code - via vti | |
# perl -MMojo::Loader -e 'Mojo::Loader->load(qq{Mojo::Loader;print "nice feature!"})' | |
# http://twitter.com/#!/vtivti/status/44408695613952000 | |
use Test::More tests => 2; |
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 | |
use warnings; | |
use strict; | |
use CGI::Fast; | |
use Capture::Tiny qw(capture); | |
use IPC::Run3 qw(run3); | |
my $cmd = 'date'; |
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
package Unity::DBI; | |
use base qw/DBIx::Class::CDBICompat/; | |
package Unity::Cluster; | |
use base 'Unity::DBI'; | |
__PACKAGE__->table('u_clusters'); | |
__PACKAGE__->table_alias('u_clusters'); | |
__PACKAGE__->sequence('obj_id'); | |
__PACKAGE__->columns(Primary => qw/id/); |
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/env perl | |
use JSON; | |
use Mojo::JSON; | |
use Test::More tests => 6; | |
my $j = JSON->new; | |
my $mj = Mojo::JSON->new; |
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
$('.concord-text') | |
.each(function(t){ | |
if ($(this).text().match(/[אבגדהוזחטיכלמנסעפצקרשת]/)) { | |
$(this).attr('dir', 'rtl'); | |
}; | |
}); |
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 File::Slurp; | |
use Tie::LevelDB; | |
my $file_name = shift; # give the script an image file argument - preferably a PNG. | |
my $db = new Tie::LevelDB::DB("db/"); | |
my $buffer; | |
read_file( $file_name, binmode => ':raw', buf_ref => \$buffer ); |
OlderNewer