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 | |
# ref https://gist.github.com/furyutei/f7e407fe4b83fd45ef5efbd64ae1a70e | |
$file = new SplFileObject($argv[1]); | |
$file->setFlags(SplFileObject::READ_CSV); | |
$arr = []; | |
$pages = []; | |
foreach ($file as $row){ | |
$page = []; |
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 rowToString(array $row) | |
{ | |
$amzn = '[link http://amazon.jp/dp/' . $row[0] . ']'; | |
$title = str_replace('[',' ',str_replace(']',' ',$row[1])); | |
$author = $row[2]; | |
$d = strtotime($row[3]); | |
$ym = date('Y-m',$d); | |
$ymd = date('Y-m-d',$d); | |
$v = " [" . $title . "] $amzn [" . $author . "]"; |
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
javascript:(function () { | |
var title = document.title; | |
if (!title) return; | |
var lines = ['', window.location.href]; | |
var quote = window.getSelection().toString(); | |
if (quote.trim()) lines = lines.concat(quote.split(/\n/g).map(function (line) { | |
return ' > ' + line; | |
})); | |
var dt = new Date(); | |
var y = dt.getFullYear(); |
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
from ubuntu:14.10 | |
run apt-get -y install aptitude | |
run aptitude -y install software-properties-common | |
run sed -i s/archive.ubuntu.com/ftp.jaist.ac.jp/ /etc/apt/sources.list | |
run apt-add-repository -y ppa:fish-shell/release-2 | |
run apt-get -y update | |
run apt-get -y install fish wget git | |
#run apt-get -y install emacs | |
run wget https://github.com/peco/peco/releases/download/v0.2.12/peco_linux_amd64.tar.gz | |
run tar zxvf peco_linux_amd64.tar.gz |
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
;; http://www.emacswiki.org/emacs/TrampAndDocker | |
(push | |
(cons | |
"docker" | |
'((tramp-login-program "docker") | |
(tramp-login-args (("exec" "-it") ("%h") ("/bin/bash"))) | |
(tramp-remote-shell "/bin/sh") | |
(tramp-remote-shell-args ("-i") ("-c")))) | |
tramp-methods) |
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
require 'formula' | |
class PdfTools <Formula | |
url 'https://github.com/politza/pdf-tools/archive/master.zip' | |
homepage 'https://github.com/politza/pdf-tools/' | |
md5 '4278b81f7a105a491b5a8699f770c802' | |
def install | |
system "./configure", "--prefix=#{prefix}", |
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
require 'formula' | |
class Rsync <Formula | |
url 'http://rsync.samba.org/ftp/rsync/src/rsync-3.1.0.tar.gz' | |
homepage 'http://rsync.samba.org/' | |
md5 '3be148772a33224771a8d4d2a028b132' | |
def install | |
system "./configure", "--prefix=#{prefix}", |
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/ruby | |
puts File.stat(ARGV[0]).mtime.strftime("%F %H.%M.%S.#{ARGV[1]}") |
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
find . -regextype posix-egrep -regex ".*/.*[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}\.[0-9]{2}\.[0-9]{2}\.jpg$" |
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 | |
for p in IMG RIM CIM | |
do | |
exiftool -d '%Y-%m-%d %H.%M.%S.jpg' "-Filename<DateTimeOriginal" ${p}_*.JPG | |
for e in MOV PNG JPG | |
do | |
for f in `ls ${p}_*.${e}` | |
do | |
t=`mov2timestr.rb $f $e` | |
mv "$f" "$t" |
NewerOlder