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/perl | |
my $args = {eax=>1,ebx=>2}; | |
my ($eax, $ebx) = @{%$args}{qw/eax ebx/}; | |
print "case1: $eax, $ebx\n"; | |
($eax, $ebx) = @{$args}{qw/eax ebx/}; | |
print "case2: $eax, $ebx\n"; |
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
- chrome,safari用 | |
- マウス移動で適当にロックオン | |
- バーストはまだない |
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 xlsx = require('xlsx'); | |
var _ = require('underscore'); | |
var file = 'test.xlsx'; | |
function parsePos(x) { // "AB" => 26*1 + 1*2 => 28 | |
var str = x.toUpperCase(); | |
var ret = 0; | |
for(var i=0,len=str.length; i<len; i++) { | |
ret += Math.pow(26,(len - i -1)) * (str.charCodeAt(i)-64); |
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
## .JPGを.jpgに一括リネームしたい | |
# 単純に置換 | |
/bin/ls -1 *.JPG | pern -npe '$_=~s/.JPG//' | xargs --replace {} mv {} {.JPG,.jpg} | |
# 長いし式があってるかよくわからないのでdryrunしたい | |
/bin/ls -1 *.JPG | perl -npe ' $_=~s/.JPG// ' | xargs --replace {} echo mv {}{.JPG,.jpg} | |
とか | |
/bin/ls -1 *.JPG | perl -nle 'printf("X=%s; echo mv \${X%.JPG}{.JPG,.jpg};\n", $_)' |
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
$ cat <<EOF >.git/hooks/post-merge | |
## mergeと同時にsubmoduleを自動update | |
echo "" | |
echo "git submodule update" | |
git submodule update | |
EOF | |
$ chmod a+x .git/hooks/post-merge |
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
#!/bin/sh | |
FILE=test.xml | |
EXPR="string(/node/node/@*[local-name()='key'])" | |
echo '[prepare1. xmllint --version]' | |
echo $( xmllint --version ) | |
echo "" | |
echo "" |
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/perl | |
# mtimeを揃える | |
# same_mtime dir1 dir2 | |
use strict; | |
use File::Find; | |
my @d = @ARGV; | |
my $our_mtime = 0; | |
sub _mtime { | |
my @st = stat $_; | |
$our_mtime = $st[9] if ($our_mtime < $st[9]); |
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
#!/bin/bash | |
## xlsxをunzipしてxmllint formatして再度zipしても読める事を確認 | |
# FLATTEN2の中身を直接書き換えて最後のzipコマンドを実行してもxlsxとして読める | |
ORIGINAL=time_sample.xlsx | |
FLATTEN1=flatten | |
FLATTEN2=reflatten | |
REZIP1=flatten.xlsx | |
REZIP1=reflatten.xlsx | |
rm -rf ${REZIP1} ${REZIP2} ${FLATTEN1} ${FLATTEN2} |
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
/** | |
* list up all script appers in NetworkLogView | |
*/ | |
function getManagedInstanceOf (obj) { | |
var observers = WebInspector.targetManager._observers; | |
for (var i = observers.length; i--;) { | |
if ( observers[i] instanceof obj ) { | |
return observers[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
- これまでの経緯 | |
- clickイベントは発生が遅いから自前でタップイベントを実装する | |
- 自前のタップ実装だとAndroidで反応が漏れることがたまによくある | |
- よくよく調べるとtouchmoveが1回しか発生してなかったり | |
- ひとまずOSの挙動をまねてみることにする | |
- 前提 | |
- SO-05D(Galaxy SX) | |
- Android4.1.2 |
OlderNewer