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
;; ==================================================================== | |
;; For tools like apheleia and flycheck, other tools that might invoke shell | |
;; commands (like csslint, csharpier, etc), We need to set the path | |
;; properly. The following functions help with that. I had some problems | |
;; getting it just right, so it now verbosely logs everything. | |
(defun my/reorder-list (list predicate) | |
"Reorders LIST so that elements satisfying PREDICATE come first. | |
Returns a new list with elements reordered according to PREDICATE. | |
The original list is not modified. |
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 | |
# -*- mode:shell-script; coding:utf-8; -*- | |
# | |
# Copyright © 2025 Google LLC. | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# https://www.apache.org/licenses/LICENSE-2.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
(defun mode-for-buffer (&optional buffer-or-string) | |
"Returns the major mode associated with a buffer." | |
(with-current-buffer (or buffer-or-string (current-buffer)) | |
major-mode)) | |
(defun my-dired-copy-or-move-other-window (operation) | |
"Copy or move the marked files to another directory. | |
OPERATION is a symbol, either `COPY' or `MOVE' . | |
This works with files or directories." | |
(unless (eq major-mode 'dired-mode) |
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
Instructions for running peloton-to-garmin (https://github.com/philosowaffle/peloton-to-garmin) in Cloud Run, assuming you're doing this from Windows Powershell v7.4.6: | |
$env:PROJECT_ID="your-gcp-project-id" | |
$env:REGION="us-west1" | |
$env:JOB_NAME="peloton-to-garmin" | |
gcloud config set core/project $env:PROJECT_ID | |
# create two GCS buckets - https://cloud.google.com/sdk/gcloud/reference/storage/buckets/create | |
# one for the output, one for the configuration file |
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
<style type='text/css'> | |
/* https://stackoverflow.com/a/63574369/48082 */ | |
body, body #index .main-content .home-page .home-page-cta h1.home-page-cta-title { | |
font-family: 'SF Pro Text',-apple-system,BlinkMacSystemFont,Roboto,'Segoe UI',Helvetica,Arial,sans-serif,'Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol'; | |
} | |
body #index > .main-content { | |
padding: 0; | |
background-color: #7d7d7d; | |
background-image: revert; |
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
// getTokenWithRetry.js | |
// ------------------------------------------------------------------ | |
// | |
// Example JS policy configuration: | |
// | |
// Note: you need the authUrl Property. | |
// | |
// <Javascript name='JS-Retrieve-Token' timeLimit='12000' > | |
// <Properties> | |
// <Property name='authUrl'>https://url-for-token-endpoint/token</Property> |
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
{ | |
"info": { | |
"_postman_id": "ac53fc95-c464-4413-8330-0ae96d1bfd1e", | |
"name": "OAuth2 Client Credentials", | |
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json", | |
"_exporter_id": "22976572" | |
}, | |
"item": [ | |
{ | |
"name": "Request-for-Token (Client credentials", |
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
$ node ./getIdTokenWithServiceAccount.js --keyfile ./my-service-account-key-a8ef19f432a9.json --audience https://foo-bar/bam | |
jwt payload: { | |
"iss": "[email protected]", | |
"aud": "https://oauth2.googleapis.com/token", | |
"iat": 1724976008, | |
"exp": 1724976068, | |
"target_audience": "https://foo-bar/bam" | |
} | |
assertion: eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzaGVldC13cml0ZXItMUBkY2hpZXNhLWFyZ29saXMtMi5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSIsImF1ZCI6Imh0dHBzOi8vb2F1dGgyLmdvb2dsZWFwaXMuY29tL3Rva2VuIiwiaWF0IjoxNzI0OTc2MDA4LCJleHAiOjE3MjQ5NzYwNjgsInRhcmdldF9hdWRpZW5jZSI6Imh0dHBzOi8vZm9vLWJhci9iYW0ifQ.rxVh1-rpXxn67zh94LBDLJm3j2jDqzlXXxV9AqUVtVYDVoKvLy5PH7oBFxrO9RgnhvYkxmbYhMWC5bKmAsaB1J7Y7m3Ch7N2C05kzvle8RHImMsIdW7_nLEISKYgZLmUTQh_oqqgyysmY6C6q0Hadt7yqJ7rZz1W_-wq2fV0hZVTAZLKlUtXefKrwK90Myzo3yZg5tA7GTFUY23b8D4gSEkMxjGR0Ke3PwR4N9SK4FKy8YlYeDsOUGfX2GNmqEIQpD7AfjLBUbnFJeKVL04c8PKXnvUAiffeqfCkwcVpVNoyFexEsB2e9ZUUL2H4A7tRR4cA0DU3OL0dkm3Bhd9qHQ |
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 | |
# -*- mode:shell-script; coding:utf-8; -*- | |
# | |
# Works with Apigee Edge. | |
# | |
proxyname="$1" | |
[[ -z "$proxyname" ]] && printf "specify a proxy name as argument\n" && exit 1 | |
MISSING_ENV_VARS=() |
NewerOlder