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
<?php | |
function upper_and_length($item) | |
{ | |
global $maxlength; | |
$item = strtoupper(preg_replace('/([a-z0-9])([A-Z])/', '$1_$2', $item)); | |
if ($maxlength < strlen($item)) | |
$maxlength = strlen($item); | |
return $item; | |
} |
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 IS_DEV = true; | |
// logger | |
var console = window.console; | |
if (IS_DEV === false || !console) { | |
console = { | |
log: function(){}, | |
debug: function(){}, | |
info: function(){}, | |
warn: 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
#! /usr/bin/env sh | |
dir=$1 | |
echo "target > $dir" | |
pattern="^No*" | |
files=`find $dir -name '*.php'` | |
for file in $files | |
do |
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
" {{{ 場所ごとの設定 | |
augroup vimrc-local | |
autocmd! | |
autocmd BufNewFile,BufReadPost * call s:vimrc_local(expand('<afile>:p:h')) | |
augroup END | |
function! s:vimrc_local(loc) | |
let files = findfile('.vimrc.local', escape(a:loc, ' ') . ';', -1) | |
for i in reverse(filter(files, 'filereadable(v:val)')) | |
source `=i` |
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
if !exists('g:inflect_pluralize_cmd') | |
let g:inflect_pluralize_cmd = "perl -MLingua::EN::Inflect=PL -E 'print PL(\"%s\")'" | |
endif | |
function! s:inflect_pluralize(word) | |
return system(substitute(g:inflect_pluralize_cmd, "%s", a:word, "g")) | |
endfunction | |
function! s:insert_(v) | |
execute "normal i" . a:v ."\<Esc>" |
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 strict; | |
use warnings; | |
use Benchmark qw/ :all /; | |
use URI; | |
use URI::WithBase; | |
my $BACKEND_URL = "http://hoge.fuga.com"; | |
sub func_a { |
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 | |
diff --git a/src/swf_tag.c b/src/swf_tag.c | |
index bff81f7..c7966ad 100644 | |
--- a/src/swf_tag.c | |
+++ b/src/swf_tag.c | |
@@ -515,9 +515,16 @@ swf_tag_get_bitmap_color1stpixel(swf_tag_t *tag, | |
*blue = swf_tag_lossless->colormap[color_index].blue; | |
} else { // Lossless2 => RGBA | |
int alpha = swf_tag_lossless->colormap2[color_index].alpha; | |
- *red = swf_tag_lossless->colormap2[color_index].red * 255 / alpha; |
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
#!perl | |
use strict; | |
use warnings; | |
use Data::Dumper; | |
my %o = ( | |
abc => 1, | |
def => 'ghi', | |
); |
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 Encode; | |
use LWP::UserAgent; | |
use HTTP::Request::Common qw(POST); | |
use Config::Pit; | |
# grappe is https://github.com/mix3/grappe |
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 regexp = /\d{4}\/\d{2}\/\d{2} \d{2}:\d{2}/, | |
links = document.getElementsByTagName('a'), | |
len = links.length, | |
i = 0; | |
for (i = 0; i < len; ++i) { | |
if (links[i].title && regexp.test(links[i].title)) { | |
links[i].innerHTML = links[i].innerHTML + "[" + links[i].title + "]"; | |
} |
OlderNewer