View ViewFunctions.pm
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 MyApp::Web::ViewFunctions; | |
use Tiffany::Text::MicroTemplate::Extended; | |
package Tiffany::Text::MicroTemplate::Extended; | |
use strict; | |
use warnings; | |
sub c { Amon2->context } |
View flymake-with-perl-carton.el
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
;; via http://d.hatena.ne.jp/trotr/20090822/1250958096 | |
;; ------------------------------------------------ | |
(require 'cl) | |
(defun myenv-string-join (sequence separator) | |
(mapconcat #'identity sequence separator)) | |
(defsubst myenv-parent-dir (path) | |
"return parent directory path of argument." | |
(substring-no-properties (file-name-directory path) 0 -1)) |
View RouterSimple.pm
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 Amon2::Web::Dispatcher::RouterSimple; | |
use strict; | |
use warnings; | |
use Router::Simple 0.03; | |
sub import { | |
my $class = shift; | |
my %args = @_; | |
my $caller = caller(0); |
View test_controller_spec.rb
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
before(:all) do | |
# DatabaseClearnerを使ってDBを初期化 | |
DatabaseClearner.clean | |
# テストユーザ作成のためのインスタンスをつくる | |
@test_users = Koala::Facebook::TestUsers.new( | |
:app_id => OmniAuthConfig::FACEBOOK_API_KEY, | |
:secret => OmniAuthConfig::FACEBOOK_SECRET_API_KEY | |
) |
View util_transcation.js
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
var $ = require('jquery-deferred'); | |
function transaction(conn, callback) { | |
var d = $.Deferred(); | |
d.done(function() { | |
conn.query('COMMIT'); | |
}).fail(function() { | |
conn.query('ROLLBACK'); | |
}); | |
conn.query('START TRANSACTION', function() { |
View htpasswd.pl
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 Getopt::Long; | |
use Apache::Htpasswd; | |
use Term::ReadKey; | |
my $create; |
View File.pm
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 Archer::Plugin::File; | |
use strict;use warnings; | |
use base qw( Archer::Plugin ); | |
use File::Spec; | |
use FindBin; | |
sub run { | |
my ($self, $context, $args) = @_; | |
my $f = File::Util->new; |
View archer-plugin-rsync.diff
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
diff --git a/lib/Archer/Plugin/Rsync.pm b/lib/Archer/Plugin/Rsync.pm | |
index c2f943c..1eebd23 100644 | |
--- a/lib/Archer/Plugin/Rsync.pm | |
+++ b/lib/Archer/Plugin/Rsync.pm | |
@@ -44,8 +44,8 @@ sub run { | |
$rsync->exec; | |
- $self->log( debug => $rsync->out ) if $rsync->out; | |
- $self->log( debug => $rsync->err ) if $rsync->err; |
View test.pl
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 Foo { | |
use IO::Prompt; | |
sub new { bless {}, shift } | |
sub ask { | |
my ($self, $msg) = @_; | |
my $echo = prompt("next: "); | |
print "You said '$echo'\n"; | |
} |
View archer-plugin-confirm.diff
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
--- a/lib/Archer/Plugin/Confirm.pm | |
+++ b/lib/Archer/Plugin/Confirm.pm | |
@@ -2,7 +2,7 @@ package Archer::Plugin::Confirm; | |
use strict; | |
use warnings; | |
use base qw/Archer::Plugin/; | |
-use IO::Prompt; | |
+use IO::Prompt::Simple; | |
sub run { |