View waitFor.js
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
/** | |
* Wait for the specified milliseconds. | |
*/ | |
async function waitFor(msec) { | |
await new Promise((resolve) => setTimeout(resolve, msec)); | |
} |
View use-WP_HTML_Tag_Processor.php
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
<?php | |
/** | |
* `WP_HTML_Tag_Processor` Modifies attributes in an HTML document for tags matching a query. | |
*/ | |
$html = '<span><img src="hello.webp" alt="hello"></span>'; | |
// Create an instance | |
$tags = new WP_HTML_Tag_Processor( $html ); |
View saveFile.js
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
// Function: | |
async function saveFile(fh, content) { | |
const stream = await fh.createWritable(); | |
await stream.write(content, {type: "text/plain"}); | |
await stream.close(); | |
} | |
// Usage: | |
const content = 'Hello world'; | |
const fh = await window.showSaveFilePicker(); |
View apache2.conf
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
# Exclude log records for internal dummy connections. | |
SetEnvIf Remote_Addr "127\.0\.0\.1" loopback | |
CustomLog ${APACHE_LOG_DIR}/access.log combined env=!loopback |
View sample-ga-data-api.py
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
"""A sample to get sessions with Python and Google Analytics Data API v1. | |
with: google-analytics-data = "^0.16.0" | |
""" | |
from pathlib import Path | |
from google.analytics.data_v1beta import BetaAnalyticsDataClient | |
from google.analytics.data_v1beta.types import ( | |
DateRange, | |
Dimension, |
View action.yml
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
name: 'Install Python and Poetry' | |
description: 'Add Poetry, dependency manager for Python' | |
inputs: | |
python-version: | |
description: 'Python version' | |
required: true | |
poetry-version: | |
description: 'Poetry version' | |
required: true |
View both-shifts-keypad-2.json
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
{ | |
"title": "Both shifts + signs => Keypad signs", | |
"rules": [ | |
{ | |
"description": "Both shifts + - => Keypad -", | |
"manipulators": [ | |
{ | |
"type": "basic", | |
"from": { | |
"key_code": "hyphen", |
View ripgrep-cheatsheet-ja.sh
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
# 非表示ファイルを対象に含める | |
# -., --hidden | |
rg --hidden git | |
# マッチしない行を返す | |
# -v, --invert-match | |
rg -v 'docker' /var/log/syslog | |
# マッチした箇所のみを返す | |
# -o, --only-matching |
View both-shifts-keypad.json
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
{ | |
"title": "Both shifts + numbers => Keypad numbers", | |
"rules": [ | |
{ | |
"description": "Both shifts + 1 => Keypad 1", | |
"manipulators": [ | |
{ | |
"type": "basic", | |
"from": { | |
"key_code": "1", |
View sample-google-analytics-data.py
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
"""A sample to get sessions with Python and Google Analytics Data API v1. | |
with: google-analytics-data = "^0.16.0" | |
""" | |
from pathlib import Path | |
from google.analytics.data_v1beta import BetaAnalyticsDataClient | |
from google.analytics.data_v1beta.types import ( | |
DateRange, | |
Dimension, |
NewerOlder