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
<# | |
元ネタは→PowerShellを使ってサイズの大きいフォルダを検出する / 開発者向けブログ・イベント | GMO Developers https://developers.gmo.jp/2035/ | |
上記スクリプトからの主な変更点は | |
・コンソールに直接貼り付けで動くようにした(なのでルートフォルダはカレントフォルダに変更) | |
・ファイルのフルパスではなくファイル名を表示するようにした | |
・フォルダ内のファイル総数を表示するようにした | |
以上の3点。 | |
#> | |
$RootFolder = "." |
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形式の年月") |
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). |
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. |
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 |
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>") |
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 | |
) |
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} |
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 |
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): |