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/bash | |
# http://kameya-z.way-nifty.com/blog/2010/10/ffmpegflvmp4-a4.html | |
file_name=$1 | |
ffmpeg -threads 4 -y -i "${file_name}" -vcodec copy -acodec copy "${file_name/.flv/m4v}" |
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
# https://qiita.com/massie_g/items/a2bcfac4fed66b1b0717 | |
FROM ubuntu:18.04 | |
# | |
# -- if you are using docker behind proxy, please set ENV -- | |
# | |
#ENV http_proxy "http://proxy.yourdomain.com:8080/" | |
#ENV https_proxy "http://proxy.yourdomain.com:8080/" |
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
# :eyes: https://github.com/tgagor/docker-jpegtran | |
function jpegtran_docker { | |
[ $(docker images jpegtran | wc -l) != 2 ] && return 1 # ahead of this, build jpegtran with https://github.com/tgagor/docker-jpegtran.git | |
local file=$1 | |
[ -z $file ] && return 1 | |
local filedir=$(dirname ${file}) | |
[ ${filedir} = "." ] && filedir=$(pwd) |
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/bash | |
for i in $(seq 1 47); do | |
wget http://nlftp.mlit.go.jp/isj/dls/data/15.0a/$(printf "%02d" $i)000-15.0a.zip | |
wget http://nlftp.mlit.go.jp/isj/dls/data/10.0b/$(printf "%02d" ${i})000-10.0b.zip | |
done |
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
// go 1.7.4 以下のベンチマークコードで go test -v -bench -benchmem を実行 | |
func BenchmarkMatchFooBarBaz(b *testing.B) { | |
r := regexp.MustCompile("^foo") | |
const input = "foo" | |
b.ResetTimer() | |
for i := 0; i < b.N; i++ { | |
r.MatchString(input) | |
} | |
} | |
// -> BenchmarkMatchFoo-4 10000000 230 ns/op 0 B/op 0 allocs/op |
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
<?php | |
// PHP 7.0.8 | |
$count = 1000000; | |
$start = microtime(true); | |
for($i = 0;$i < $count; $i++) { | |
preg_match("/^foo/", "foo"); | |
} | |
$end = microtime(true); | |
echo 1000000000 * (($end - $start) / $count) . " ns/op" . PHP_EOL; | |
// -> 200 ns/op 程度 |
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
package api | |
import ( | |
"testing" | |
) | |
const iteration = 2 | |
func Benchmark_AppendString1(b *testing.B) { | |
for i := 0; i < b.N; i++ { |
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
# 少し凝った zshrc | |
# License : MIT | |
# http://mollifier.mit-license.org/ | |
######################################## | |
# 環境変数 | |
export LANG=ja_JP.UTF-8 | |
path=(/opt/otto/bin ~/.apachehere/bin ~/.pyenv/shims ~/.rbenv/shims ~/bin(N-/) /usr/local/bin(N-/) /usr/local/heroku/bin ~/.composer ~/.composer/vendor/bin ~/.nodebrew/current/bin /Developer/NVIDIA/CUDA-7.0/bin ${path}) | |
export CUDA_HOME=/usr/local/cuda |
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/bash -xv | |
letsencrypt_path=$1 | |
if [ ! -e ${letsencrypt_path}/certbot-auto ]; then | |
pushd ~/ | |
git clone https://github.com/letsencrypt/letsencrypt && [ ! -e ${letsencrypt_path}/certbot-auto ] && exit 1 | |
popd | |
fi | |
domain_name=$2 |
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
sed -e "s/Jan/1/g" -e "s/Feb/2/g" -e "s/Mar/3/g" -e "s/Apr/4/g" -e "s/May/5/g" -e "s/Jun/6/g" -e "s/Jul/7/g" -e "s/Aug/8/g" -e "s/Sep/9/g" -e "s/Oct/10/g" -e "s/Nov/11/g" -e "s/Dec/12/g" | |
NewerOlder