Skip to content

Instantly share code, notes, and snippets.

View TakamiChie's full-sized avatar
:octocat:

高見知英 TakamiChie

:octocat:
View GitHub Profile
@TakamiChie
TakamiChie / launch.ps1
Last active July 7, 2020 12:44
19H2対応版:chocolateyとMicrosoft TeamsとChromium EdgeをセットアップしUI設定を日本語に設定したWindowsサンドボックスを立ち上げる(全ファイルを同じフォルダにおいてね)
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"
@TakamiChie
TakamiChie / alerm.ps1
Created June 16, 2020 14:49
ファイルが出力されたらアラームを鳴らす
while($True){ if((dir ./*.*).Length -ne 0){C:\Windows\Media\Alarm01.wav; break} sleep 1 }
@TakamiChie
TakamiChie / brigade.js
Created June 5, 2020 08:14
Code for Japanのサイトからブリゲイド一覧を取得する
// 今後使う機会あるかないか分からないけど。
// ブリゲード - Code for JapanCode for Japan https://www.code4japan.org/brigade で、開発者コンソールを開き以下をコピペ
let t = ""; Array.from(document.querySelectorAll(".list--brigade li")).forEach((e) => { t = `${t}${e.innerText} @ ${e.querySelector("a") ? e.querySelector("a").href : "URL None"}\n` }); console.log(t);
@TakamiChie
TakamiChie / listup.js
Created January 13, 2020 12:02
SharePointリストのグループヘッダのキャプションを収集する
// SharePointリストを表示し、一つの列でグループ化した状態で、下の行を開発者コンソールに入れて実行
Array.from(document.querySelectorAll(".ms-GroupedList-group")).forEach(e => console.log(e.querySelector(".ms-GroupHeader-title").textContent));
@TakamiChie
TakamiChie / makeholidaylist.py
Last active October 23, 2019 09:22
金・土・日・祝の日付リストを作るやつ。伝助の日程調整候補のデータを作るのに使う
# ローカル環境ならこれでOK。PaizaIOだと動かない。
# コピペでコンソールに貼り付ければ動く
import datetime
import calendar
import locale
import jpholiday
locale.setlocale(locale.LC_ALL, 'ja_JP.UTF-8')
def daterange(_start, _end):
@TakamiChie
TakamiChie / rename.ps1
Created October 15, 2019 04:43
ファイルの一括リネーム(Google Play Musicからダウンロードした音楽向け)
# コピペで使うとよさげ
dir | rename-item -newname { $_.name -replace '\A\d\d\s-\s','' }
@TakamiChie
TakamiChie / upload.ps1
Created August 30, 2019 10:03
PyPIへのライブラリアップロードスクリプト
Remove-Item "*.egg-info" -Recurse
Remove-Item "dist" -Recurse
Remove-Item "build" -Recurse
python setup.py sdist
python setup.py bdist_wheel
$title = "PyPI upload?"
$message = "The package was created in the `dist` folder. Can I continue uploading to PyPI?"
$tChoiceDescription = "System.Management.Automation.Host.ChoiceDescription"
$options = @(
New-Object $tChoiceDescription ("Yes(&Y)", "Upload the library to PyPI.")
@TakamiChie
TakamiChie / splist2text
Created August 21, 2019 11:46
SharePointリストをテキスト化する
// See the right for details. https://qiita.com/TakamiChie/items/e7c8e7ed5d37949298cd
// ==ClosureCompiler==
// @compilation_level ADVANCED_OPTIMIZATIONS
// @output_file_name default.js
// ==/ClosureCompiler==
// ADD YOUR CODE HERE
(function(){
a = "";
f = document.querySelector(".ms-DetailsRow-cellCheck div:first-child[aria-checked=true]") == null;
@TakamiChie
TakamiChie / reviewkwds.txt
Created February 12, 2019 12:16
Clipboard-History用のRe:Viewのキーワードリスト
; Clipboard-History用のRe:Viewのキーワードリストです。
; @include=reviewkwds.txtなどとしてお使いください。
+ブロック命令(&B)
リスト(&L) | //listnum[id][caption][lang]{`r`n`r`n//}`r`n
埋め込みリスト(&E) | //emlistnum[id][caption][lang]{`r`n`r`n//}`r`n
行番号指定(&F) | //firstlinenum[num]`r`n
コマンド(&C) | //cmd{`r`n`r`n//}`r`n
イメージ(&G) | //image[id][caption]{`r`n`r`n//}`r`n
番号無し図(&P) | //indepimage[id][caption]`r`n
@TakamiChie
TakamiChie / choosesentence.py
Created January 27, 2019 09:22
Sentenceフォルダ配下のファイルをコピーして貼り付ける
"""
Sentenceフォルダ配下のファイルをコピーして貼り付ける
uwstyle, pyperclipモジュールのインストールが必要
`pip install uwstyle, pyperclip`
# Clipboard-Historyで使う場合の例
センテンスフォルダ(&S) || Run | C:\Users\TakamiChie\AppData\Local\Packages\6432853C62D86.ClipboardHistory_mmq3pnrvshaxt\LocalCache\Roaming\ClipboardHistory\choosesentence.py | I O
"""
from uwstyle.dialogs import select
from pathlib import Path
import pyperclip