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
| package AnyEvent::Semaphore; | |
| use common::sense; | |
| use AnyEvent; | |
| use Try::Tiny; | |
| use Carp 'croak'; | |
| use Class::Accessor::Lite ( | |
| ro => [ qw(limit waiting) ], | |
| ); |
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
| goog.provide('json.digest'); | |
| goog.require('goog.array'); | |
| goog.require('goog.crypt'); | |
| goog.require('goog.crypt.Hash'); | |
| goog.require('goog.crypt.Sha1'); | |
| goog.require('goog.object'); | |
| /** | |
| * @param {Object} item |
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
| """ | |
| pass in a bunch of synchronous partials to get executed concurrently | |
| example: | |
| import asyncio | |
| import functools | |
| user_can_read = lambda res: functools.partial( | |
| perms.can_read, some_user, some_res, some_perms, | |
| ) | |
| is_readable = await async_gather(map(user_can_read, items) |
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
| #! /usr/bin/env python3 | |
| import sys | |
| import argparse | |
| import json | |
| import netrc | |
| import textwrap | |
| import urllib.parse | |
| import urllib.request | |
| import urllib.error |
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
| package utils.jira; | |
| import com.google.gson.GsonBuilder; | |
| import org.asynchttpclient.*; | |
| import org.asynchttpclient.request.body.multipart.FilePart; | |
| import org.asynchttpclient.uri.Uri; | |
| import java.io.*; | |
| import java.nio.charset.StandardCharsets; | |
| import java.util.Collections; |
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
| /* | |
| * Requires Lambda Proxy Integration | |
| * | |
| * Example usage | |
| * | |
| * curl -s https://SomeGatewayID.execute-api.us-east-1.amazonaws.com/test/aws/DynamoDB.DocumentClient/default/query -X PUT -H 'X-api-key:TheKey' -d '{"TableName":"SomeTable","KeyConditionExpression":"id = :id","ExpressionAttributeValues":{":id":"SomeID"}}' -H 'Content-Type: application/json' | jq . | |
| * curl -s https://SomeGatewayID.execute-api.us-east-1.amazonaws.com/test/aws/SimpleDB/2009-04-15/listDomains -X PUT -H 'X-api-key:TheKey' | jq . | |
| */ | |
| const API_KEY = '' + process.env['API_KEY'] |
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
| /** | |
| * Wait for Grid to come online | |
| * @param url to check, e.g. http://127.0.0.1:4444/wd/hub/status | |
| * @param duration value | |
| * @param unit of duration | |
| */ | |
| public static boolean waitForSeleniumGrid(String url, long duration, TemporalUnit unit) throws ExecutionException, InterruptedException { | |
| Instant start = Instant.now(); | |
| Instant stopWaiting = start.plus(duration, unit); | |
| final ScheduledExecutorService ses = Executors.newSingleThreadScheduledExecutor(); |
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
| env: | |
| {{- if .Values.env -}} | |
| {{- if gt (len .Values.env) 0 -}} | |
| {{- range $k, $v := .Values.env }} | |
| {{- if kindIs "string" $v }} | |
| - name: {{ $k }} | |
| value: {{ tpl ($v | toString) $ | quote }} | |
| {{- else }} | |
| - name: {{ $v.name }} | |
| value: {{ tpl ($v.value | toString) $ | quote }} |
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
| #cloud-config | |
| locale: en_CA.UTF-8 | |
| locale_configfile: /etc/default/locale | |
| package_update: true | |
| package_upgrade: true | |
| packages: | |
| - ca-certificates | |
| - libpam-google-authenticator | |
| write_files: | |
| - path: /etc/ssh/sshd_config.d/10-google-authenticator.conf |
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
| #!/usr/bin/env bash | |
| set -euo pipefail | |
| RG=$1 | |
| AKS=$2 | |
| POOL=$3 | |
| SUB=$(az account show -o tsv --query id) |