Skip to content

Instantly share code, notes, and snippets.

View KenshoFujisaki's full-sized avatar

藤崎 顕彰 KenshoFujisaki

View GitHub Profile
@KenshoFujisaki
KenshoFujisaki / concat_mp4_files.sh
Last active September 19, 2020 07:09
複数のMP4ファイルを無劣化で連結するシェルスクリプト ワンライナー
# 使い方)
# video_1.mp4, video_2.mp4, video_3.mp4,… を video.mp4 に連結したい時、
# 冒頭のfilenameにファイル接頭辞videoを渡す。つまり、filename=videoとする。
# ※FFMPEGを事前インストールしておく必要があります。 (macの場合は、$ brew install ffmpeg)
filename=ファイル名接頭辞;ffmpeg -f concat -safe 0 -i <(for f in ${filename}_*.mp4; do echo "file '$PWD/$f'"; done) -codec copy ${filename}.mp4
@KenshoFujisaki
KenshoFujisaki / chrome_extension_button.scpt
Created August 9, 2020 20:48
AppleScriptでGoogleChrome拡張ボタンを押下するテスト
-- cf. https://forum.keyboardmaestro.com/t/clicking-specific-chrome-extension-buttons/11950/17
-- GoogleChromeでのイベント名取得確認
tell application "Google Chrome"
activate
delay 0.3
end tell
tell application "System Events"
tell front window of (first application process whose frontmost is true)
@KenshoFujisaki
KenshoFujisaki / pdf2svg.sh
Created May 20, 2020 02:11
PDF形式からSVG形式にベクタ変換
# pdf2svgをインストール
brew install pdf2svg
# なお、brewコマンドが見つからない(Homebrew未インストール)の場合は下記実行してインストールする。ref: https://brew.sh/index_ja
# /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
# pdfファイルをsvgファイルに変換
# 例)input.pdfファイルをoutput.svgに変換出力する場合
pdf2svg input.pdf output.svg
@KenshoFujisaki
KenshoFujisaki / .cvimrc
Last active September 22, 2019 04:25
cVimrc
"ref: https://rcmdnk.com/blog/2014/10/22/computer-firefox/
"ref: https://fewlight.net/20151023/
"Settings
let scrolltep = 200
let fullpagescrollpercent = 100
"set nohud
"set autohidecursor
"set noinsertmappings
set nosmoothscroll
@KenshoFujisaki
KenshoFujisaki / video2png.bat
Last active September 25, 2016 07:49
動画をpngに変換(要ffmpeg)
mkdir "%~dp0\%~n1"
ffmpeg -i "%1" -vcodec png -sameq "%~dp0\%~n1\%%d.png"
@KenshoFujisaki
KenshoFujisaki / zshで履歴をpeco実行.sh
Last active November 6, 2015 19:10
zshで履歴をpeco実行
#------------------------------------------------------------------------------
# 履歴
#------------------------------------------------------------------------------
alias his="fc -l -f 0 | sort -r | peco"
setopt extended_history
function peco-select-history() {
local tac
if which tac > /dev/null; then
tac="tac | uniq"
else
@KenshoFujisaki
KenshoFujisaki / _vimperatorrc_highlight_urls.js
Last active September 8, 2015 22:21
ページ内のすべてのURLについて,正規表現`url_regex`にマッチするものを紫色で強調 for vimperator
"=============================================================================="
" Hightlight matched URLs "
" usage(example): "
" :highlightUrls [regex] "
" :highlightUrls github|gitlab "
"=============================================================================="
js <<EOM
commands.addUserCommand(
["highlightUrls"],
"Highlight matched URLs",
@KenshoFujisaki
KenshoFujisaki / highlight_match_urls.js
Last active September 8, 2015 17:15
ページ内のすべてのURLについて,正規表現`url_regex`にマッチするものを紫色で強調
// ページ内のすべてのURLについて,正規表現`url_regex`にマッチするものを紫色で強調
var url_regex = /hatena/;
var iterator = document.evaluate("//a", document, null, 5, null);
var highlighter = function(elm) {
elm.style =
"font-weight:900;" +
"color:white;" +
"background-color:purple;";
};
var node;
@KenshoFujisaki
KenshoFujisaki / calculate_technical_dept.sh
Last active August 29, 2015 14:23
技術的負債の定量化
# ref: 第8回 Perlによる大規模システム開発・設計のツボ(3):Perl Hackers Hub|gihyo.jp … 技術評論社
# http://gihyo.jp/dev/serial/01/perl-hackers-hub/000803
# コンポーネントの単一責務性の違反指数(SRP)
# SRP=R+U+((L/100)-5)
# R:修正リビジョンのユニーク数
# U:修正ユーザのユニーク数
# L:モジュールのライン数
function get_SRP() {
local target_filepath=$1
@KenshoFujisaki
KenshoFujisaki / diff_rspec_execution.sh
Last active August 29, 2015 14:22
gitコミット前後のRSpecの実行結果で、Failureケースの差分を出力するシェル
#!/bin/bash
# constants
seed_number=1234
# check args
if [ $# -ne 2 ]; then
echo "usage: $0 [before_revision_hash] [after_revision_hash]"
echo "e.g.: $0 212dfa0 0bc3dc7"
echo "e.g.: $0 0bc3dc7^ 0bc3dc7"