Skip to content

Instantly share code, notes, and snippets.

@tsuyukimakoto
tsuyukimakoto / gopro_hero9_mp4_exif_sample.txt
Created September 9, 2023 03:48
GoPro Hero9 mp4 exif sample
This file has been truncated, but you can view the full file.
$ exiftool -ee GX010351.MP4
ExifTool Version Number : 12.50
File Name : GX010351.MP4
Directory : /Volumes/Untitled/DCIM/100GOPRO
File Size : 4.0 GB
File Modification Date/Time : 2023:09:07 07:17:03+09:00
File Access Date/Time : 2023:09:09 12:43:12+09:00
File Inode Change Date/Time : 2023:09:07 07:17:03+09:00
File Permissions : -rwxrwxrwx
File Type : MP4
# Update exif information of image files in yyyy_mm_dd folder to yyyy_mm_dd 10:00:00
# need exiftool <- brew install exiftool
from pathlib import Path
import subprocess
def dt_fmt(dir_name):
yyyy, mm, dd = dir_name.split('_')
return f'{yyyy}:{mm}:{dd} 10:00:00'
@tsuyukimakoto
tsuyukimakoto / if_then.go
Created July 2, 2022 10:29
scopeを狭くできるif
package main
import "fmt"
func a() (x string, y bool) {
return "test", true
}
func main() {
if _, y := a(); y {
@tsuyukimakoto
tsuyukimakoto / convert_alnum_zenhan.py
Created June 20, 2021 02:01
数字・アルファベット・+-を全角から半角に変換(他の文字はそのまま)
ALNUM_ZEN = ("0123456789"
"ABCDEFGHIJ"
"KLMNOPQRST"
"UVWXYZ"
"abcdefghij"
"klmnopqrst"
"uvwxyz"
"+ー")
ALNUM_HAN = ("0123456789"
@tsuyukimakoto
tsuyukimakoto / private_var.py
Last active May 4, 2020 13:21
Python's private variable starts with dunder(double under) and not ends with dunder.
class Spam:
def __init__(self):
self._var = "I'm under var"
self.__dunder_var = "I'm double under var"
def get_var(self):
return self._var
def get_dunder_var(self):
tap "homebrew/bundle"
tap "homebrew/cask"
tap "homebrew/core"
brew "gist"
brew "tree"
cask "alfred"
cask "backblaze"
cask "dropbox"
cask "google-backup-and-sync"
cask "google-chrome"
tap "homebrew/bundle"
tap "homebrew/cask"
tap "homebrew/core"
brew "tree"
cask "alfred"
cask "backblaze"
cask "dropbox"
cask "google-backup-and-sync"
cask "google-chrome"
cask "iterm2"

Keybase proof

I hereby claim:

  • I am tsuyukimakoto on github.
  • I am everes (https://keybase.io/everes) on keybase.
  • I have a public key whose fingerprint is 3B98 CA31 64C8 8826 ACFE 864C 9E2F BB83 6F29 5DCC

To claim this, I am signing this object:

@tsuyukimakoto
tsuyukimakoto / sqlite_tips.md
Created July 11, 2019 08:30
sqliteのメモ

SELECT文の結果にカラム名を表示するようにする

.headers ON

SELECT文の結果を詰めない

.mode column

他にも tabs や html や csv などいくつかある。

@tsuyukimakoto
tsuyukimakoto / bad_password.py
Last active June 22, 2019 03:27
assignable expression and regex
import re
def check(passwd):
if (password_length := len(passwd)) < 1:
return 'Need password'
if (m := re.search(r'^%s+' % passwd[0], passwd)) and m.span()[1] == password_length:
return '{0} contains only same character'.format(passwd)
return '{0} is suitable for password'.format(passwd)
if __name__ == '__main__':