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
| # .bashrc | |
| # ======= | |
| to-mp4-baseline () | |
| { | |
| if [ -z "$2" ]; then | |
| OUT="$1.mp4"; | |
| else | |
| OUT="$2"; | |
| fi; | |
| if [ -f "$OUT" ]; then |
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
| /** | |
| * ユーザープロフィールが開いた状態で実行すると | |
| * そのユーザーをブロックする | |
| * @param {DOMElement} document | |
| * @return {Promise<>} | |
| * 成功した場合Resolve(引数なし)する | |
| */ | |
| function block_user(document=window.document) { | |
| function wait_for_element(query, timeout_ms=1100) { | |
| return new Promise((resolve, reject) => { |
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/bash | |
| # demo : https://twitter.com/cocoamatic/status/1187539670214688768 | |
| BAR_LENGTH=50 # progress bar width | |
| make_progress_bar() { | |
| # $1 : progress | |
| # $2 : total | |
| # example : BAR=$(make_progress_bar 66 200) | |
| PERCENT=$(awk -vn=$1 'BEGIN{printf("%.2f%%", 100*n/'$2')}') |
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
| #ifndef ESP_IDF_TEMPLATE_MQTT_APP_HPP | |
| #define ESP_IDF_TEMPLATE_MQTT_APP_HPP | |
| #include <stdio.h> | |
| #include <stdint.h> | |
| #include <string.h> | |
| #include "defines.h" | |
| #define CONFIG_LOG_DEFAULT_LEVEL ESP_LOG_DEBUG |
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 node | |
| /* prints out : | |
| ........ | |
| ..@@@@.. | |
| .@....@. | |
| .@....@. | |
| .@....@. | |
| .@....@. | |
| .@....@. | |
| .@....@. |
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
| curl 'https://www.mercari.com/jp/search/?keyword=%E4%BF%A1%E5%8F%B7%E6%A9%9F+LED' -H 'accept-encoding: gzip, deflate, br' \ | |
| | gunzip -c \ | |
| | hxnormalize -x \ | |
| | hxselect -s "\n\n\n" 'section.items-box' |
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/bash | |
| HIRAGANA="ひらがな (Google)" | |
| US="U.S." | |
| change_ime() { | |
| read -r -d '' SCRIPT <<End | |
| tell application "System Events" to tell process "SystemUIServer" | |
| tell (1st menu bar item of menu bar 1 whose value of attribute "AXDescription" is "text input") | |
| return {its value, click, click menu 1's menu item "$1"} | |
| end tell |
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/bash | |
| set -e | |
| LOG_GROUP_NAME="$1" | |
| LOG_STREAM_NAME="$2" | |
| if [ -z "$LOG_GROUP_NAME" -o -z "$LOG_STREAM_NAME" ]; then | |
| echo "usage : $0 [LOG_GROUP_NAME] [LOG_STREAM_NAME]">&2 | |
| exit 1 | |
| fi |
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 -*- | |
| # | |
| # computes CRC of each file in current working directory (including subdirectories) | |
| # usage: python3 python-multiprocess-example.py | |
| # | |
| import sys | |
| import os | |
| import glob | |
| import zlib |
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
| // サークレットプリンセスのデータが欲しいので(ry | |
| // | |
| // 使い方 | |
| // | |
| // 0. ゲームを立ち上げる : http://pc-play.games.dmm.com/play/circlet_princess/ | |
| // 1. ゲーム起動中に XHR Breakpoint (Pause on any URL) を付ける | |
| // 2. なにかする(e.g. ガチャ画面に移動)と、Debuggerが立ち上がる | |
| // 3. JS コンソールに以下を入力する | |
| // | |
| // let w = window.open(); w.FS = FS; w.that = this; |