Skip to content

Instantly share code, notes, and snippets.

View craftgear's full-sized avatar
🏠
Working from home

Captain Emo craftgear

🏠
Working from home
  • self-employed
  • Japan
View GitHub Profile
@craftgear
craftgear / gist:944a23d226f6e3734bb5de2f68178c73
Created December 2, 2023 08:41
ffmpegを使って2秒に1枚の割合でスクショを撮る
ffmpeg -i movie.mp4 -r 1/2 ./frame_%04d.jpg
@craftgear
craftgear / cut.sh
Created December 1, 2020 11:14
Twitter用に動画の一部を切り抜いてフェードイン・フェードアウトするワンライナー
#!/bin/sh
# 使い方
# cut.sh 開始時間 終了時間 元のファイル
#
# 例) 1時間32分15秒から、1時間34分5秒まで切り取る
# cut.sh 1:32:15 1:34:05 input.mp4
ffmpeg -ss $1 -to $2 -i "$3" -vf fade=d=1.0,reverse,fade=d=1.0,reverse -af afade=d=1.0,areverse,afade=d=1.0,areverse -c:a aac output.mp4
@craftgear
craftgear / avif.md
Last active March 5, 2021 02:34
avifについて調べたことまとめ 2021年3月時点

比較

表示

  • Chrome 85以降
  • Firefox 77以降
    • about:configでフラグを立てる必要あり

編集

@craftgear
craftgear / batch_stitching.py
Last active December 27, 2020 07:39
A4サイズ以上の雑誌を分割スキャンした後に使う画像結合Pythonスクリプト
# 使い方
# $ python batch_stitching.py -i 画像のあるディレクトリ
#
# 結合する画像は重なっている部分が必要です。
# 画像の天地は揃えたほうがよいです。縦横が違うとズレが出ます。
# opencv-contrib-pythonとimutilsを別途インストールする必要があります。
import os
import functools
import argparse
@craftgear
craftgear / iphone12_display_sizes.md
Created October 26, 2020 06:57
iPhone12のディスプレイサイズ計算してみた
  • アスペクト比は 1:2.167 (9:19.5)
  • 1inch = 25.4mm
モデル 対角
iPhone12 mini 137.16mm 57.6mm 124.8mm
iPhone12 159.94mm 67mm 145.2mm
iPhone12 Pro 159.94mm 67mm 145.2mm
iPhone12 Pro Max 170.18mm 71.5mm 154.9mm
@craftgear
craftgear / purge_purgeable_area.sh
Last active October 25, 2020 00:48
macOSのパージ可能領域を掃除するワンライナー
#!/bin/sh
# こちらのブログを参考にしました https://dafuku2.blogspot.com/2019/09/macos.html
# TimeMachineが使っている分しか消せないので、パージ可能領域は完全になくなりません。
# 結構時間がかかります。
tmutil listlocalsnapshots / | rg -e '\d{4}-\d{2}-\d{2}-\d{6}' -o | xargs -I date tmutil deletelocalsnapshots date

Privacy Policy

craftgear built the あんしんQRコードリーダー app as a Free app. This SERVICE is provided by craftgear at no cost and is intended for use as is.

This page is used to inform visitors regarding my policies with the collection, use, and disclosure of Personal Information if anyone decided to use my Service.

If you choose to use my Service, then you agree to the collection and use of information in relation to this policy. The Personal Information that I collect is used for providing and improving the Service. I will not use or share your information with anyone except as described in this Privacy Policy.

The terms used in this Privacy Policy have the same meanings as in our Terms and Conditions, which is accessible at あんしんQRコードリーダー unless otherwise defined in this Privacy Policy.

@craftgear
craftgear / init_cypress.md
Last active June 15, 2021 08:13
Cypressを導入してe2eテストをかけるようにするまでにやったこと

Cypress導入手順

インストール

  1. npm install cypress --save-dev
  2. npx cypress open →自動でcypress.jsonとcypress用のディレクトリが作られる
  3. cypress.json に設定を追加する
{
  "baseUrl": "http://localhost:8080",
  "viewportWidth": 1280,
  "video": true,
@craftgear
craftgear / beyond_for_loop.js
Last active October 6, 2018 04:29
#SurviveJS 05 LT「forループを越えて」
const double = x => x * 2;
const over5 = x => x > 5;
const a = [1, 2, 3].map(double).filter(over5);
console.log('********* a', a);
import * as R from 'ramda';
const times2Over5 = R.compose(
R.tap(console.log),
@craftgear
craftgear / dummy_todos.json
Last active August 12, 2018 08:09
dummy_todos.json
{
"data": [
{
"id": 1,
"title": "Reactコンポーネントを作れるようになる",
"done": false,
"created_at": "2018-08-08 12:00:00",
"started_at": "",
"done_at":""
},