Skip to content

Instantly share code, notes, and snippets.


高見知英 TakamiChie

View GitHub Profile
TakamiChie /
Created Jan 31, 2022
# python .\ -s 2022/01 -e 2022/01 -o -> 2022年1月のダイジェストを作る。
from datetime import datetime
from datetime import timedelta
from argparse import ArgumentParser
import calendar
import sys
p = ArgumentParser()
p.add_argument("-s", "--start_date", type=lambda s: datetime.strptime(s, "%Y/%m"), required=True, help="開始月。yyyy/mm形式の年月")
p.add_argument("-e", "--end_date", type=lambda s: datetime.strptime(s, "%Y/%m"), required=True, help="終了月。yyyy/mm形式の年月")
TakamiChie /
Created Jan 15, 2022
YouTube playlist auto-configuration tool
* # Usage
* 1. start a new Google Apps Script project and paste this code into the script area.
* 2. After saving, set the `main()` function to be executed automatically.
* # Operation
* 1. Create a playlist.
* 2. Set the title of the video you want to add to the playlist as "Playlist Name:Video Title"(Colons can be full-size or half-size).
function main() {
// Get the necessary items (own channel object, playlist list, video list).
TakamiChie / PassGen.ps1
Created Jan 13, 2022
Simple Password Generator
View PassGen.ps1
# PassGen -> Output 8-character password
# PassGen 10 -> Output a 10-character password.
# PassGen 10 $false -> Do not include symbols.
# PassGen 10 $false $false -> Do not include symbols and numbers.
# PassGen 10 $true $false $false -> Symbols only (setting all to false will of course result in an error)
# The maximum length of the password that can be output is 93 characters.
# Useful Usage).
# PassGen | clip -> Copy the generated password directly to the clipboard
# Write a function in WindowsPowerShell\Microsoft.PowerShell_profile.ps1(PowerShell folder for PowerShell 7.x) -> You can use the PassGen command at any time.
TakamiChie / 0001prepare.bat
Created Sep 15, 2021
standfm_bgm, standfm_photoを使って、複数の音声ファイルにBGMをつける
View 0001prepare.bat
rem あらかじめstandfm_bgm, standfm_photoのリポジトリは、ドキュメント\Github\にクローンしてあるものとする
@echo off
prompt $G$G$S
@echo on
cd %USERPROFILE%\Documents\Github\standfm_photo
pipenv run %*
cd %USERPROFILE%\Documents\Github\standfm_bgm
pipenv run %*
echo Complete
TakamiChie /
Created Jun 13, 2021
choco list --localonlyから一括処理用のXMLファイルを作る
import sys
print("""<?xml version="1.0" encoding="utf-8"?>
for line in sys.stdin:
l = line.strip().split(" ")
if l[1] != "packages":
print(f' <package id="{l[0]}" version="{l[1]}" />')
TakamiChie / mp3tomp4.bat
Last active Apr 30, 2021
View mp3tomp4.bat
@echo off
rem パスの通ったフォルダにファイルを置いておくと、`mp3tomp4 abc.mp3 abc.png`みたいな感じでコマンドを呼べる。デスクトップにabc.mp4が生成される。
set %FILES=
rem Create file args
if "%~2"=="" (
echo Drop two or more files.
exit /b
TakamiChie / createfolders.ps1
Created Jan 7, 2021
View createfolders.ps1
# プロンプトにコピペする
foreach($n in 1..12){New-Item "${n}" -ItemType Directory}
TakamiChie /
Created Dec 8, 2020
# ReportLab, PyPDF2, TQDMは事前にpipでインストールしておいてください。
import random
import sys
import os
from pathlib import Path
from argparse import ArgumentParser
from tqdm import tqdm
from PyPDF2 import PdfFileReader, PdfFileWriter
from reportlab.pdfgen import canvas
TakamiChie /
Last active Oct 19, 2020
import re
import pyperclip
import sys
from time import sleep
n = []
p = []
text = pyperclip.paste()
for m in re.finditer(r"「([^」]*)」", text, re.MULTILINE):
n.append(re.sub(r"\n\s*", "", m[1]))
for m in re.finditer(r"([\d,]+)\s*円", text, re.MULTILINE):
TakamiChie / launch.ps1
Last active Jul 7, 2020
19H2対応版:chocolateyとMicrosoft TeamsとChromium EdgeをセットアップしUI設定を日本語に設定したWindowsサンドボックスを立ち上げる(全ファイルを同じフォルダにおいてね)
View launch.ps1
Set-Content -Path "$env:TEMP\temp.wsb" -Value (Get-Content "$PSScriptRoot\template.wsb" | % { $_ -replace "%CURRENT%", $PSScriptRoot })
Start-Process $env:TEMP\temp.wsb -Wait
Remove-Item "$env:TEMP\temp.wsb"