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
| from google.appengine.ext import webapp | |
| from google.appengine.ext.webapp.util import run_wsgi_app | |
| import httplib | |
| class StatusCode(webapp.RequestHandler): | |
| def get(self, code): | |
| self.response.headers['Content-Type'] = 'text/html' | |
| content = 'statuscode : ' + code + '<br>' | |
| for c, m in httplib.responses.iteritems(): |
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
| sub indent_html { | |
| my $html = shift; | |
| my $indent = 0; | |
| return join "\n", grep { $_ !~ /^\s*$/ } map { | |
| s{(^\s+|\s+$)}{}g; | |
| if (m{</}) { | |
| $indent--; | |
| } | |
| $indent = 0 if $indent < 0; | |
| my $res = ' ' x $indent . $_; |
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 strict; | |
| use warnings; | |
| system( | |
| "$ENV{HOME}/perl5/bin/cpanm", | |
| map { | |
| s/\.pm$// and s{/}{::}g; # Can't locate | |
| s/^perl-// and s{-}{::}g; # yum | |
| $_; |
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 Benchmark 'cmpthese'; | |
| my $tagname = shift; | |
| cmpthese( | |
| 1_000_000, | |
| { | |
| regexp => sub { regexp($tagname) }, | |
| lc_eq => sub { lc_eq($tagname) }, | |
| regexp_subst => sub { regexp_subst($tagname) }, |
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
| #!/bin/sh | |
| if [ $# -eq 2 ] | |
| then | |
| i=$2 | |
| else | |
| i=`whoami` | |
| fi | |
| declare -i mine=`git blame $1 | grep -i $i | wc -l` |
NewerOlder