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
type GraphProp={[key:string]:string[]} | |
const buildGraph = (edges:string[][]):GraphProp=>{ | |
const result :GraphProp= {} | |
for(const edge of edges){ | |
const [a,b]= edge | |
if(!(a in result)) result[a]=[] | |
if(!(b in result)) result[b]=[] | |
result[a].push(b) | |
result[b].push(a) |
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
# These are here to help the IDE recognise AWS types. | |
# | |
# Place this file outside the 'schema' directory so are not pushed to AWS, | |
# but are still picked up by PhpStorm's GraphQL plugin to help | |
# validate schemas. | |
# | |
# https://docs.aws.amazon.com/appsync/latest/devguide/scalars.html | |
# | |
scalar AWSDateTime | |
scalar AWSDate |
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
#!/usr/bin/env sh | |
KEYSTORE_FILE=./keystore.jks | |
KEYSTORE_PASS=agweria | |
HOST=$1 | |
PORT=$2 | |
# get the SSL certificate | |
openssl s_client -connect "${HOST}":"${PORT}" </dev/null | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' >"${HOST}".cert |
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 java.time.Instant | |
import java.time.ZoneId | |
import java.time.format.DateTimeFormatter | |
fun main() { | |
val time=DateTimeFormatter | |
.ofPattern("yyyyMMddHHmmss") | |
.withZone(ZoneId.of("Africa/Nairobi")) | |
.format(Instant.now()) | |
println(time) |