Skip to content

Instantly share code, notes, and snippets.

View vkgtaro's full-sized avatar
😃

Taro Komatsu vkgtaro

😃
View GitHub Profile
Index: lib/Catalyst/Controller/Resource.pm
===================================================================
--- lib/Catalyst/Controller/Resource.pm (リビジョン 33201)
+++ lib/Catalyst/Controller/Resource.pm (作業コピー)
@@ -73,7 +73,7 @@
sub _parse_PathPrefix_attr {
my ($self, $c, $name, $value) = @_;
- return PathPart => $self->path_prefix;
+ return PathPart => $self->{path} || $self->path_prefix;
package MT::Plugin::TextLivedoorWiki;
use strict;
use warnings;
use utf8;
my $VERSION = "0.01";
use MT;
MT->add_text_filter(
my $public_key = <<__END_OF_PUBLIC__;
-----BEGIN PUBLIC KEY-----
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDASPndWVBy/VYe99aVM/5PWVdS
D3Vb5uAlK4cAPz091V/1SOeL3YSRuOposPMDjf5TlQuUr/TmNE6cbAUFV0hLFQuB
69KmJN+Bt8JwptFbuFetNKaMVESntg69+VPeuvuqo2+Ob7dcTXnvNxTfdJcwga9f
W5Af9jh82kQTWmZf5QIDAQAB
-----END PUBLIC KEY-----
__END_OF_PUBLIC__
my $verifier = OAuth::Lite::SignatureMethod::RSA_SHA1->new(
sub resize {
my ( $self, $key, $info ) = @_;
my ( $x, $y ) = ( $info->{x}, $info->{y} );
my $img = Imager->new();
unless ( $img->read( file => $self->request->uploads->{$key}->tempname ) ) {
$self->log->fatal($img->errstr);
return;
}
use strict;
use warnings;
use utf8;
use AnyEvent;
use Plack::Request;
use Plack::Builder;
use IO::Handle::Util qw(io_from_getline);
use Encode;
use strict;
use warnings;
use utf8;
use AnyEvent;
use Plack::Builder;
use IO::Handle::Util qw(io_from_getline);
my $hanlder = sub {
my $env = shift;
=== dependancy
--- result eval
0
--- param yaml
ab: 1
aa: 1
bb: 1
--- config yaml
lang : ja
rules:
# -*- coding: utf-8 -*-
$LOAD_PATH << "lib"
require 'rubygems'
require 'twitter'
require 'logger'
require 'oauth'
require 'yaml'
require 'singleton'
@vkgtaro
vkgtaro / hello.py
Created November 24, 2010 16:23
quickstart flask
from flask import Flask, request, render_template
app = Flask(__name__)
@app.route('/')
def index():
return 'Index Page'
@app.route('/hello')
def hello():
return "Hello World!"
@vkgtaro
vkgtaro / twitter.rb
Created February 19, 2011 17:36
Citrus で twitter の内容を表示する plugin
#!/usr/bin/env ruby
# -*- coding: utf-8 -*-
require "rubygems"
require "twitter"
require "timeout"
class Twitter < Default
def process(uri)