Skip to content

Instantly share code, notes, and snippets.

@Yyukan
Yyukan / http4szio.scala
Created March 1, 2019 07:45
Http4s example with ZIO
import cats.effect
import scalaz.zio._
import scalaz.zio.interop.catz._
import org.http4s._
import org.http4s.dsl.io._
import org.http4s.implicits._
import org.http4s.server.Router
import org.http4s.server.blaze.BlazeServerBuilder
import scalaz.zio.clock.Clock
@angelo-v
angelo-v / jwt-decode.sh
Last active July 12, 2024 09:51
Decode a JWT via command line
# will not work in all cases, see https://gist.github.com/angelo-v/e0208a18d455e2e6ea3c40ad637aac53#gistcomment-3439904
function jwt-decode() {
sed 's/\./\n/g' <<< $(cut -d. -f1,2 <<< $1) | base64 --decode | jq
}
JWT=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.TJVA95OrM7E2cBab30RMHrHDcEfxjoYZgeFONFh7HgQ
jwt-decode $JWT
@olvesh
olvesh / configmapcase.yaml
Last active June 14, 2022 09:08
Configmap with subfolders in pod
apiVersion: v1
kind: ConfigMap
metadata:
name: testconfig
data:
file1: |
some stuff
file2: |
some other stuff in subdir
---
@Vidimensional
Vidimensional / CopySQS.py
Created May 18, 2016 12:09
Copy between different SQS queues.
#!/usr/bin/env python
import json
import time
import argparse
import boto.sqs
from termcolor import cprint
@emil2k
emil2k / Connectivity.java
Last active December 22, 2023 06:03
Android utility class for checking device's network connectivity and speed.
/*
* Copyright (c) 2017 Emil Davtyan
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions: