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
(function () { | |
if (typeof Ti !== 'undefined') return; | |
var global = new Function('return this;')(); | |
var Titanium = function () {}; | |
Titanium['API'] = function () {}; | |
Titanium['Accelerometer'] = function () {}; | |
Titanium['Analytics'] = function () {}; | |
Titanium['Android'] = function () {}; |
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
#!zsh | |
function git_info() { | |
local info | |
if test -z $(git rev-parse --git-dir 2> /dev/null); then | |
info='' | |
else | |
info="${$(git symbolic-ref HEAD 2> /dev/null)#refs/heads/}" | |
fi | |
echo -n "$info" | |
} |
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
snippet u | |
#!/usr/bin/env perl | |
use 5.10.0; | |
use strict; | |
use warnings; | |
snippet d | |
use Data::Dump qw(dump); | |
warn dump |
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
Object.prototype.keys = function (i) { | |
var keys = Object.keys(this); | |
return (i >= 0) ? keys[i] : keys; | |
}; | |
Object.prototype.values = function (i) { | |
var self = this; | |
var values = Object.keys(this).map(function(key){ | |
return self[key]; | |
}); |
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 Parent; | |
use strict; | |
use warnings; | |
sub new { bless {}, $_[0] } | |
1; |
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 LWP::UserAgent; | |
use Sub::Retry qw(retry); | |
my $TryTimes = 3; | |
my $Interval = 1; | |
my $UserAgent = LWP::UserAgent->new; | |
sub _ua { $UserAgent->clone } | |
sub get { |
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 URI; | |
use Data::Dumper; | |
sub dump_uri { | |
my $uri = ref($_[0]) eq 'URI::http' ? $_[0] : URI->new($_[0]); | |
my ($base, $param_string) = split /\?/, $uri; | |
my $result = $base; | |
if ($param_string) { | |
$result .= "\n"; | |
local $Data::Dumper::Indent = 1; | |
local $Data::Dumper::Terse = 1; |
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
BEGIN { | |
no warnings 'redefine'; | |
no strict 'refs' | |
my $orig = \&{__PACKAGE__ . '::import'}; | |
*{__PACKAGE__ . '::import'} = sub { | |
... | |
$orig->(@_); | |
}; | |
}; |
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
--- vimparse.pl.old 2011-12-25 22:19:36.000000000 +0900 | |
+++ vimparse.pl 2011-12-26 00:01:48.000000000 +0900 | |
@@ -63,6 +63,9 @@ | |
use strict; | |
use Getopt::Std; | |
+use Cwd qw(getcwd); | |
+use Path::Class qw(file); | |
+use Project::Libs; |
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 utf8; | |
use Path::Class qw/file/; | |
use Encode; | |
use Email::Sender::Simple qw/try_to_sendmail/; | |
use Email::MIME; | |
use Email::MIME::Creator; | |
use Email::Sender::Transport::SMTP::TLS; |