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/env perl | |
use strict; | |
use warnings; | |
# TBD: locate these using env? | |
# mac | |
my $growl = '/usr/bin/growlnotify'; |
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
var MAX = 10000000, i; | |
var arr = []; | |
console.time("assignment"); | |
for (i = 0; i < MAX; i++) { | |
arr[arr.length] = i; | |
} | |
console.timeEnd("assignment"); |
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 File::Basename 'dirname'; | |
use File::Spec; | |
my $bin; | |
BEGIN { | |
$bin = join( '/', File::Spec->splitdir(dirname(__FILE__)) ); | |
} |
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
diff --git a/lib/Mojo/Command.pm b/lib/Mojo/Command.pm | |
index 1a92e50..8cfa2dd 100644 | |
--- a/lib/Mojo/Command.pm | |
+++ b/lib/Mojo/Command.pm | |
@@ -118,6 +118,9 @@ sub get_all_data { | |
my $all = {}; | |
while (@data) { | |
my ($name, $content) = splice @data, 0, 2; | |
+ if ( $name =~ s/;base64$// ) { | |
+ $content = b($content)->b64_decode->to_string; |
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 MojoX::JSON; | |
use Mojo::JSON; | |
our $SINGLETON; | |
BEGIN { | |
# install JSON::XS if you can! | |
eval 'use JSON();'; | |
eval ( $@ ? 'sub HAS_JSON(){ 0 }' : 'sub HAS_JSON(){ 1 }' ); |
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
<script> | |
// create a QR code to this page's href using google's chart api | |
// positioned in the right corner. click to enlarge. click again to hide | |
// http://googlecode.blogspot.com/2008/07/qr-codes-now-available-on-google-chart.html | |
document.write([ | |
'<img src="http://chart.apis.google.com/chart?chs=150x150&cht=qr&choe=UTF-8&chld=L|1&chl=', | |
encodeURIComponent(window.location.href), | |
'" width="35" height="35" alt="QR Code" title="Click Me!" ', | |
'style="position:absolute;top:10px;right:10px;" ', | |
'onclick="if(this.width==35){this.width=this.height=150;}else{this.style.display=\'none\';}"/>' |
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 | |
# Copyright 2010 (c) David Davis - http://xant.us/ | |
# BSD License | |
# built using webtreemap | |
# http://github.com/martine/webtreemap | |
# *DOWNLOAD MOJO FIRST* | |
# git clone http://github.com/kraih/mojo.git |
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/env perl | |
use Mojolicious::Lite; | |
use EV; | |
use AnyEvent::IRC::Client; | |
# Join #mojo on irc.perl.org | |
my $irc = AnyEvent::IRC::Client->new; | |
$irc->connect('irc.perl.org', 6667, {nick => "mojobot$$"}); | |
$irc->send_srv(JOIN => '#mojo'); |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |