View digest.py
This file contains 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
# python .\digest.py -s 2022/01 -e 2022/01 -o 202201digest.md -> 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形式の年月") |
View main.gs
This file contains 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
/** | |
* # 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). |
View PassGen.ps1
This file contains 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
# 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. |
View 0001prepare.bat
This file contains 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
rem あらかじめstandfm_bgm, standfm_photoのリポジトリは、ドキュメント\Github\にクローンしてあるものとする | |
@echo off | |
prompt $G$G$S | |
@echo on | |
cd %USERPROFILE%\Documents\Github\standfm_photo | |
pipenv run title.py %* | |
cd %USERPROFILE%\Documents\Github\standfm_bgm | |
pipenv run main.py %* | |
echo Complete |
View chocolateyxml.py
This file contains 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 sys | |
print("""<?xml version="1.0" encoding="utf-8"?> | |
<packages>""") | |
for line in sys.stdin: | |
l = line.strip().split(" ") | |
if l[1] != "packages": | |
print(f' <package id="{l[0]}" version="{l[1]}" />') | |
print("</packages>") |
View mp3tomp4.bat
This file contains 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
@echo off | |
rem パスの通ったフォルダにファイルを置いておくと、`mp3tomp4 abc.mp3 abc.png`みたいな感じでコマンドを呼べる。デスクトップにabc.mp4が生成される。 | |
set %FILES= | |
rem Create file args | |
if "%~2"=="" ( | |
echo Drop two or more files. | |
pause | |
exit /b | |
) |
View createfolders.ps1
This file contains 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
# プロンプトにコピペする | |
foreach($n in 1..12){New-Item "${n}月" -ItemType Directory} |
View testpdf_creator.py
This file contains 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
# 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 |
View copytool.py
This file contains 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 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): |
View launch.ps1
This file contains 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
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" |
NewerOlder