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
import { defaultProvider } from "@aws-sdk/credential-provider-node"; | |
import { HttpRequest } from "@aws-sdk/protocol-http"; | |
import { Sha256 } from '@aws-crypto/sha256-js'; | |
import { SignatureV4 } from "@aws-sdk/signature-v4"; | |
import { stringify } from "qs"; | |
async function main(): Promise<string> { | |
const signer = new SignatureV4({ | |
credentials: defaultProvider(), | |
region: process.env.AWS_REGION, |
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
[...document.querySelectorAll('#past-expenses-table .td.small:nth-child(5)')].reduce( | |
(total, cell) => { | |
const amountWithCurrencyAsString = cell.innerHTML; | |
const amountWithoutCurrencyAsString = amountWithCurrencyAsString.slice(3); // $CA... | |
return total + parseFloat(amountWithoutCurrencyAsString); | |
}, | |
0 | |
); |
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
Terraform v1.3.4 | |
on linux_amd64 | |
# ... | |
2023-03-10T02:59:18.165Z [DEBUG] provider.terraform-provider-github_v5.18.0: 2023/03/10 02:59:18 [INFO] Selecting owner my-org from GITHUB_OWNER environment variable | |
2023-03-10T02:59:18.168Z [DEBUG] provider.terraform-provider-github_v5.18.0: 2023/03/10 02:59:18 [INFO] Setting write_delay_ms to 1000 | |
2023-03-10T02:59:18.168Z [DEBUG] provider.terraform-provider-kubernetes_v2.11.0_x5: 2023/03/10 02:59:18 [DEBUG] Enabling HTTP requests/responses tracing | |
# ... | |
-----------------------------------------------------: timestamp=2023-03-10T02:59:18.166Z-----------------------------------------------------: timestamp=2023-03-10T02:59:18.290Z | |
2023-03-10T02:59:18.304Z [DEBUG] provider.terraform-provider-github_v5.18.0: 2023/03/10 02:59:18 [DEBUG] GitHub API Response Details: | |
2023-03-10T02:59:18.304Z [DEBUG] provider.terraform-provider-github_v5.18.0: ---[ RESPONSE ]-------------------------------------- |
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
#!/bin/bash | |
service_to_find=$1 | |
context_list_as_string=$(kubectl config get-contexts -o name) | |
context_list=($context_list_as_string) | |
for ctx in ${context_list[@]}; do | |
if kubectl get deploy --context=$ctx | grep -q "$service_to_find"; then | |
echo "Found $service_to_find deployment in $ctx" |
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
{ | |
"accentFromPage": false, | |
"accentOnWindow": true, | |
"accentSaturationLimit": 1, | |
"alpha": 1, | |
"backgroundImage": "", | |
"backgroundPosition": "stretch", | |
"blur": 0, | |
"colorAccentBg": "#d8edff", | |
"colorBg": "#f4f6f9", |
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
/** | |
* Allows for sequentially running batches of async operations. | |
* @param {number} concurrency The maximum number of operations to run concurrently. | |
*/ | |
export function batch(concurrency: number) { | |
return async function <TElement, TResult>(xs: Array<TElement>, handler: (x: TElement) => TResult): Promise<Array<TResult>> { | |
const results: Array<TResult> = []; | |
const batches = Array.from({ length: Math.ceil(xs.length / concurrency) }, (_, i) => i) | |
for await (const batchNumber of batches) { |
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
#f4f6f9,#e0e5ee,#d8edff,#0070d2,#e0e5ee,#16325c,#4bca81,#000000,#e0e5ee,#16325c |
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
// === Parameter definition === | |
interface RouteParameterBase { | |
description?: string; | |
nullable?: boolean; | |
required?: boolean; | |
} | |
interface BooleanRouteParameter extends RouteParameterBase { | |
type: 'boolean'; |
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
import { EventEmitter } from 'events'; | |
import { getInstance } from './core-util/mongo'; | |
import { ChangeEvent, ChangeEventCR, ChangeEventDelete, ChangeEventUpdate, ChangeStream, ObjectId } from 'mongodb'; | |
type ChangeListenerFunction<T> = (payload: T) => void; | |
interface User { | |
address: { | |
city: string | |
country: string |
NewerOlder