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
ffmpeg -i MAH01360.MP4 -filter_complex "[0:v]rotate=15*PI/180[v1]; [v1]crop=1440:810:240:135[v2]; [v2]scale=1920:1080" out.mp4 |
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
COPY ( | |
SELECT | |
A2.id AS "記事ID", | |
A2.title AS "タイトル", | |
A2.sub_title AS "サブタイトル", | |
CONCAT('https://XXX.com/', IMG.width, '/', IMG.height, '/', IMG.filename) AS "画像URL", | |
A2.content AS "本文", | |
A2.html_content AS "HTML本文", | |
A2.meta_description AS "META ディスクリプション", | |
A2.author_id AS "投稿者ID", |
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
# lists.csv | |
# ID,Email,Name | |
# 1,user001@examplemail,Name001 | |
# 2,user002@examplemail,Name002 | |
# 3,user003@examplemail,Name003 | |
cat lists.csv | perl -ne 'if(@r=split(m/\r/,$_)){ | |
foreach(@r) { | |
if(@x=split(/,/,$_)) { | |
$token=join('\'''\'', map +(0..9,'\''a'\''..'\''z'\'','\''A'\''..'\''Z'\'')[rand(62)], 1..32); |
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
[DELETE] | |
# delete files with numbers | |
for i in {101..151}; do rm -f "file_$i.json"; done | |
[FILE] | |
# check file infomations | |
file -I test.png | |
# sort by modified time |
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
import java.io.BufferedReader; | |
import java.io.FileReader; | |
import org.json.*; | |
public class t { | |
public static void main(String[] args) throws Exception { | |
BufferedReader br = new BufferedReader(new FileReader("1.json")); | |
try { | |
StringBuilder sb = new StringBuilder(); |
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
### Calculate total sum for prices in a file | |
# file content sample: | |
#I, [2017-05-09T23:50:19.364803 #19144] INFO -- : 32:userA の売上集計をしました(2880円) | |
#I, [2017-05-09T23:50:20.212623 #19144] INFO -- : 33:userB は売上がないので飛ばしました | |
#I, [2017-05-09T23:50:27.657490 #19144] INFO -- : 51:userC の売上集計をしました(175738円) | |
grep -r "円" sales.log-20170510 | gawk 'match($0, /.*\((.*)円\)$/, a) {print a[1]}' | awk '{ sum += $1 } END { print sum }' | |
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
### Docker MEMO | |
# install | |
sudo apt-get update | |
sudo apt-get install -y docker.io | |
sudo ln -sf /usr/bin/docker.io /usr/local/bin/docker | |
# download image | |
docker pull ubuntu:17.04 |
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
yum install -y git git-core zlib zlib-devel gcc-c++ patch readline readline-devel \ | |
libyaml-devel libffi-devel openssl-devel make bzip2 autoconf automake \ | |
libtool bison curl sqlite-devel ImageMagick ImageMagick-devel mysql-devel | |
cd ~ | |
git clone git://github.com/sstephenson/rbenv.git .rbenv | |
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile | |
echo 'eval "$(rbenv init -)"' >> ~/.bash_profile | |
git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build |
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
var f = function(i) { | |
$.ajax({ | |
url: 'https://api-native-jizen.kamihimeproject.net/csrf', | |
dataType: 'json', | |
type: 'GET', | |
xhrFields: { | |
withCredentials: true | |
} | |
}).done(function(data) { | |
$.ajax({ |
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
ActiveRecord::Base.logger = Logger.new(STDOUT) | |
post = Post.find(3936) | |
ActiveModel::ArraySerializer.new([post], serializer: PostSerializer).to_json |