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
"""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, |
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
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 |
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
{ | |
"title": "Both shifts + signs => Keypad signs", | |
"rules": [ | |
{ | |
"description": "Both shifts + - => Keypad -", | |
"manipulators": [ | |
{ | |
"type": "basic", | |
"from": { | |
"key_code": "hyphen", |
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
# 非表示ファイルを対象に含める | |
# -., --hidden | |
rg --hidden git | |
# マッチしない行を返す | |
# -v, --invert-match | |
rg -v 'docker' /var/log/syslog | |
# マッチした箇所のみを返す | |
# -o, --only-matching |
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
{ | |
"title": "Both shifts + numbers => Keypad numbers", | |
"rules": [ | |
{ | |
"description": "Both shifts + 1 => Keypad 1", | |
"manipulators": [ | |
{ | |
"type": "basic", | |
"from": { | |
"key_code": "1", |
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
"""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, |
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:(() => { | |
let url = new URL(document.location.href); | |
url.searchParams.append('rh', 'p_6:AN1VRQENFRJN5'); | |
window.location.assign(url); | |
})() |
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
from importlib.machinery import SourceFileLoader | |
from importlib.util import module_from_spec, spec_from_file_location | |
from pathlib import Path | |
def import_path(path: Path): | |
module_name = path.stem.replace('-', '_') | |
loader = SourceFileLoader(module_name, str(path)) | |
spec = spec_from_file_location(module_name, path, loader=loader) |
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
[tool.pyright] | |
include = ["mypackage"] | |
pythonVersion = "3.10" | |
venvPath = "/path/to/poetry/virtualenvs" | |
venv = "venv_dir_name" |
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
# Get timestamp of current date/time. | |
alias timestamp='date "+%s"' | |
# Get timestamp of today 00:00:00. | |
alias timestamp_today='date -v0H -v0M -v0S "+%s"' | |
# Take timestamp and print it in human-readable format (in the current timezone). | |
alias timestamp_parse='date -r' | |
# Take timestamp and print it in human-readable format (in UTC). |