This file contains hidden or 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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# ============================================================================== | |
# | |
# PDF を時計回りに 90 度回転させる | |
# | |
# https://github.com/mstamy2/PyPDF2 | |
# ============================================================================== | |
import os |
This file contains hidden or 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
# -*- coding: utf-8 -*- | |
import json | |
import urllib.parse | |
import subprocess | |
OPEN_CMD = 'start' # Windows | |
# OPEN_CMD = 'open' # macOS | |
USER_NAME = 'saitotetsuya' | |
SCRAPBOX_URL_FORMAT = 'https://scrapbox.io/{project}/{title}?body={body}' |
This file contains hidden or 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 ------------------------------------------------------------------------------ | |
REM ロボホンの画面(背面LCD・プロジェクタ)をPNGでキャプチャします。 | |
REM | |
REM 以下の外部コマンドをインストールしてパスを通しておいてください。 | |
REM * GraphicsMagick | |
REM http://www.graphicsmagick.org/ | |
REM * Android Debug Bridge(ADB) | |
REM https://developer.android.com/studio/command-line/adb?hl=JA |
This file contains hidden or 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
javascript:(function() { | |
const project = 'https://scrapbox.io/[プロジェクト名]/'; /* 自分のプロジェクト名に変更 */ | |
if (!window.location.href.startsWith('https://www.amazon.co.jp')) { | |
return; | |
} | |
const isKindle = window.location.href.indexOf('-ebook') > 0; | |
const title = document.body.querySelector("span[id='productTitle'], span[id='ebooksProductTitle']"); | |
if (title === null) { | |
return; | |
} |
This file contains hidden or 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
# | |
# 事前準備 | |
# pip install pure-python-adb pillow | |
# | |
# 実行方法 | |
# $ adb tcpip 5555 | |
# $ adb connect [ロボホンのIPアドレス]:5555 | |
# ※USBケーブルを抜く | |
# $ python robohon-capture.py | |
# |
This file contains hidden or 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
javascript:(function() { | |
const promptTitle = 'ScrapboxLink'; | |
let prompt; | |
if (window.location.href.startsWith('https://www.amazon.co.jp')) { | |
const isKindle = window.location.href.indexOf('-ebook') > 0; | |
const title = document.body.querySelector("span[id='productTitle'], span[id='ebooksProductTitle']"); | |
if (title === null) { | |
return; | |
} | |
const asin = document.body.querySelector("input[name='ASIN'], input[name='ASIN.0']"); |
This file contains hidden or 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
#!/bin/env python | |
# | |
# aibo Developer Site: https://developer.aibo.com/jp/home | |
# https://developer.aibo.com/jp/docs#api-%E3%81%AE%E5%AE%9F%E8%A3%85%E4%BE%8B を書き替えてみた | |
# | |
# 環境変数「AIBO_TOKEN」にトークンを設定 | |
# 環境変数「AIBO_DEVICE_ID」に aibo のデバイス ID を設定(一匹前提) | |
# | |
import json | |
import os |
This file contains hidden or 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
# -*- code: utf-8 -*- | |
# | |
# python rename.py [-c|--count count] [-d|--dir directory] [-n|--dry-run] [-t|--timestamp] regex target | |
# | |
# count: 連番の開始番号。デフォルトは0 | |
# directory: リネームするファイルがあるディレクトリ | |
# regex: リネームするファイルにマッチする正規表現 | |
# target: 文字列のformatと同じ書式。引数の0番目は連番,1番目以降は前方参照の値が入る | |
# | |
# python rename.py 'filename-(\w+).jpg' 'hoge-{1}-{0:0>4}.txt' |
This file contains hidden or 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
#include <M5StickC.h> | |
#define PIR_PIN 36 | |
#define PIR_DETECTION_DELAY_MSEC 2000 | |
#define FILL_MSEC 500 | |
#define TIMER_MSEC 30000 | |
bool startTimer(unsigned long ms) { | |
for (int y = M5.Lcd.height() - 1; y >= 0; --y) { |
This file contains hidden or 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
/* | |
ATOM Lite を BLE マウスにして,定期的にマウスカーソルを | |
動かすことでスクリーンセーバーを起動しないようにする。 | |
https://github.com/T-vK/ESP32-BLE-Mouse を Arduino IDE に | |
インストールしておくこと。 | |
1. ATOM Liteにプログラムを書き込む。 | |
2. プログラムを起動する。 | |
3. ATOM Lite BLE Mouseとペアリングする。 |
OlderNewer