Skip to content

Instantly share code, notes, and snippets.

View TakamiChie's full-sized avatar

高見知英 TakamiChie

View GitHub Profile
@TakamiChie
TakamiChie / 3.ipynb
Created July 21, 2026 02:03
3週間の行動ログ取得
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@TakamiChie
TakamiChie / toggl24.ipynb
Last active July 11, 2026 12:41
Toggl24時間活動ログ
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@TakamiChie
TakamiChie / pickup.js
Created June 25, 2026 18:31
窓の杜から最新のトピックの記事URLを抜き出す(開発者コンソール用)
// 窓の杜のトップページにて、開発者コンソールに以下の内容をコピペして実行
// URLリストをNotebookLMなどに貼り付けて概要を得たいときなどに便利
console.log([...new Set(Array.from(document.querySelectorAll("#daily-block-0 li a")).map(a => a.href).filter(url => url.endsWith(".html")))].join("\n"));
@TakamiChie
TakamiChie / Code.gs
Created July 23, 2025 10:30
NotionページをPDFとして取得するGoogle Apps Script
const NOTION_API_URL = "https://api.notion.com/v1/";
function doGet(e) {
return ContentService.createTextOutput("It works!");
}
function doPost(e) {
const payload = JSON.parse(e.postData.contents);
const pageId = payload.data?.id || payload.pageId;
const title = payload.data.properties["名前"].title[0].plain_text;
@TakamiChie
TakamiChie / Get-Dump.psm1
Last active July 11, 2025 10:47
ファイルダンプを表示するスクリプト。カジュアルにファイルの種別を識別するときなど
<#
.SYNOPSIS
ファイルダンプを表示する
.PARAMETER FilePath
読み込むファイル名
.PARAMETER Length
読み込むバイト数。省略時16バイト。-1を指定するとファイル全体を読み込み可能
#>
function Get-Dump{
param (
@TakamiChie
TakamiChie / コード.gs
Created July 7, 2025 00:19
Notionのイベント情報を元に、Googleカレンダーに「横浜滞在」または「普代滞在」というイベント予定を入力するツール(Google Apps Script)
function doPost(e) {
try {
const raw = e.postData.contents;
Logger.log("受信データ: " + raw);
console.log("受信データ: " + raw);
const json = JSON.parse(raw);
// キャプション: 名前プロパティ
const caption = json.data.properties["名前"].title[0].plain_text;
@TakamiChie
TakamiChie / Watch-Downloads.ps1
Created June 8, 2025 09:57
ダウンロードフォルダを監視し、wevやwebmがあれば変換する。要ffmpegインストール。
# 2-space indent
param(
[string]$DownloadPath = "$env:USERPROFILE\Downloads"
)
# 変換テーブル: 拡張子 → 出力拡張子 + ffmpeg 追加引数
$targets = @{
'.wav' = @{ Out = 'mp3'; Extra = @() }
'.webm' = @{ Out = 'mp4'; Extra = @('-c:v','copy','-c:a','aac') }
}
@TakamiChie
TakamiChie / WP2MD.js
Created May 18, 2025 13:14
WordPressの記事をMarkdown形式(書式無し)でコピーするブックマークレット
javascript:(() => {
function wrapTextWithLineBreaks(text, maxLen = 50, forceBreakLen = 60) {
let result = '', currentLine = '';
for (let char of text) {
currentLine += char;
if (currentLine.length >= maxLen && /[。!?]/.test(char)) {
result += currentLine.trim() + '\n'; currentLine = '';
} else if (currentLine.length >= forceBreakLen) {
result += currentLine.trim() + '\n'; currentLine = '';
}
@TakamiChie
TakamiChie / events.js
Created April 18, 2025 12:27
横浜市役所アトリウムのイベント情報の取得
{
let event = [];
Array.from(document.querySelectorAll(".fc-event-container")).forEach((e) => {
event.push({
"date": e.querySelector(".screen-reader-text").innerText,
"title": e.querySelector(".fc-title").innerText,
"url": e.querySelector("a").href
});
});
event.forEach(e => console.log(`${e.date}:${e.title}( ${e.url} )`));
@TakamiChie
TakamiChie / Notion→はてなブログ.py
Created April 18, 2025 10:47
Notionに書いたテキストをはてなブログに貼り付けるやつ(見出しレベル変更+URLを埋め込み形式に変更)
# prompt: 変数input_textの内容をMarkdown形式のテキストと見なし、以下の処理を行う
# * 見出しのレベルを2下げる
# * URL参照のラベル部は破棄し、次の形式に変更する[<URL>:embed:cite]
import re
import ipywidgets as widgets
from IPython.display import display, Javascript
def process_markdown(markdown_text):
# 見出しレベルを2下げる