Skip to content

Instantly share code, notes, and snippets.

View yuya-maemichi-synspective's full-sized avatar
🛰️
spaced out

Yuya Maemichi yuya-maemichi-synspective

🛰️
spaced out
View GitHub Profile
@yuya-maemichi-synspective
yuya-maemichi-synspective / restart-chrome.AppleScript
Created May 8, 2023 06:15
Apple OSA scripts e.g. AppleScripts
#!/usr/bin/osascript
tell application "Google Chrome"
open location "chrome://restart"
end tell
<input
type="file"
accept=".gif,.jpeg,.jpg,.mov,.mp4,.png,.svg,.webm,.csv,.docx,.fodg,.fodp,.fods,.fodt,.gz,.log,.md,.odf,.odg,.odp,.ods,.odt,.patch,.pdf,.pptx,.tgz,.txt,.xls,.xlsx,.zip"
>
{
"$schema": "https://json-schema.org/draft/2019-09/schema",
"$comment": "Schema for Google Cloud IAM Policy",
"$id": "https://cloud.google.com/iam/docs/reference/rest/v1/Policy",
"title": "Google Cloud IAM Policy",
"description": "An Identity and Access Management (IAM) policy, which specifies access controls for Google Cloud resources.",
"type": "object",
"required": [],
"properties": {
"version": {
fn main() {
let v0 = vec![0, 1, 2];
let v1 = vec![3, 4, 5];
vec![v0, v1].concat()
}
# ref. https://starship.rs/ja-jp/config/
"$schema" = 'https://starship.rs/config-schema.json'
# right prompt
#right_format = """$gcloud$time"""
[gcloud]
symbol = 'GCP:'
format = 'on [$symbol$account(@$domain)(\($active:$project;$region\))]($style) '
[gcloud.region_aliases]
pp %x(kubectl api-versions).scan(/(?:(?<group>\S+)\/)?(?<version>\w+)/)
pp %x(kubectl api-versions).split.map { /(?:(?<group>\S+)\/)?(?<version>\w+)/.match(_1)&.named_captures }
SELECT
*
FROM
`region-asia-northeast1`.INFORMATION_SCHEMA.TABLE_STORAGE
WHERE
total_rows > 0
-- OR total_logical_bytes > 0
-- OR total_physical_bytes > 0
ORDER BY
storage_last_modified_time desc
@yuya-maemichi-synspective
yuya-maemichi-synspective / FileUpload.ts
Last active November 22, 2023 06:47
Slack SDK has a loose typing
// https://github.com/slackapi/node-slack-sdk/blob/1312f6222497ca58af6788ea32744d7fd85964ce/packages/web-api/src/methods.ts#L1975-L1984
type Buffer = object;
type Stream = object;
type FileUpload = (
| {
channels?: string; // comma-separated list of channels
}
| {
softwareupdate --fetch-full-installer --full-installer-version '13.6' &&
open '/Applications/Install macOS Ventura.app'
git remote |
xargs -n1 -I% git symbolic-ref refs/remotes/%/HEAD |
cut -d/ -f4