Skip to content

Instantly share code, notes, and snippets.

View ff2.sh
#!/bin/sh
for arg in "$@"; do
ffmpeg -i "${arg}" -codec:v copy -b:v 5000k -y "${arg%.*}.mp4"
done
View vv2.sh
#!/bin/sh
ffmpeg -ss $1 -i "$2" -t $3 -codec:v copy -b:v 5000k "$4"
View pivot.md

MySQL (MariaDB) で行と列を入れ替える

結論

CASE WHENで行を列に変換し、GROUP_CONCATで連結する。

テーブルと得たい結果のイメージ

以下のテーブルがあったとする。

View HowToDownloadPlaylistWith_youtube-dl.md
  • Install youtube-dl
brew install youtube-dl
  • Save your youtube cookies

** Open Google Chrome

View mnist-example.py
# from https://weblabo.oscasierra.net/python/keras-mnist-sample.html
import keras
from keras.datasets import mnist
from keras.models import Sequential
from keras.layers import Dense, Dropout, InputLayer
from keras.optimizers import RMSprop
# read MNIST
(x_train, y_train), (x_test, y_test) = mnist.load_data()
View vv.sh
#!/bin/sh
ffmpeg -ss $1 -i "$2" -t $3 -vf scale=1920:1080,crop=1920:1080:0:90 -c:v h264_videotoolbox -b:v 5000k "$4"
View Flutter4RN.md
View docker-compose.yaml (mariadb)
mariadb-data:
image: busybox
volumes:
- /var/lib/mysql
container_name: mariadb-datastore
mariadb:
image: mariadb:latest
volumes_from:
- mariadb-data
View generate_ansible_inventory_ssh_config.py
# -*- coding: utf-8 -*-
import sys
import commands
hosts = """\
[docker]
{0}
"""
View install_python_to_boot2docker.sh
#!/bin/sh
if [ -z "$1" ]; then
echo "$0 <vm name>"
exit -1
fi
docker-machine ssh $1 -- tce-load -wi python.tcz
docker-machine ssh $1 -- sudo ln -s /usr/local/bin/python /usr/bin/python
docker-machine ssh $1 -- 'curl https://bootstrap.pypa.io/get-pip.py | sudo python -'
docker-machine ssh $1 -- sudo pip install docker-py