Skip to content

Instantly share code, notes, and snippets.

ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDqGiNI0Co9JAKytfce4UVhEJj+HMaoZ7TFiLg8SBeRDxV+OLma9rqDVkVqrxW5rkGMco3/Xhm/uGu+rkODJD/aZD/1fpzEsNUQIKhP9VXlVx98CMYOMCXTrgXZGdNPs0CzIb0TDI3W1tOGAA0VOZL+DGb/pUFiWeADLA9GiA8qnhahQp6yCNf8zpt3ATawSOGDLttB+PQPvwwUGMozihCcn84Kbf2Q0aQEl5J0kPLQTgBTJ1pPjTqBmkBWhP1KKAEDz3ziUmFF2eoZax7B+VXYlI6nPeETqFWkke6/EVLRqOXC4nYXKUbX2HloiEGkv4ifzzuGyS2Tdiysx0dthVcv cardno:000608624146
@defn
defn / kv
Created December 28, 2018 02:00 — forked from nilium/kv
A few shell scripts for creating JSON from a shell
#!/usr/bin/env bash
while [ $# -gt 0 ]; do
jq -nc --arg k "$1" --arg v "$2" '{($k): (try ($v|fromjson) catch $v)}'
shift; shift
done | jq -sc add
@defn
defn / docker-compose.yml
Created November 1, 2018 23:56 — forked from BlinkyStitt/docker-compose.yml
zerotier 6PLANE, docker, and consul
# you need to set ZT6PLANE to match your network
version: '2.3'
networks:
zerotier:
driver: bridge
enable_ipv6: true
internal: false
ipam:
@defn
defn / cljs-serverless.md
Created September 11, 2018 00:56 — forked from lilactown/cljs-serverless.md
CLJS in AWS Lambda Quick Start
#!/usr/bin/env bash
# from http://hipersayanx.blogspot.com/2012/12/object-oriented-programming-in-bash.html
function Vector {
# A pointer to this Class. (2)
local base=$FUNCNAME
local this=$1
# Inherited classes (optional). (3)
@defn
defn / README.md
Created August 6, 2018 06:51 — forked from mfikes/README.md
eval in ClojureScript

ClojureScript master now has cljs.core/eval. This delegates to cljs.core/*eval* which, by default throws, but you can bind it to any implementation that can compile and evaluate ClojureScript forms.

If you require the cljs.js namespace (which is the main support namespace for self-hosted ClojureScript), then cljs.core/*eval* is set to an implementation that uses self-hosted ClojureScript for this capability. This means that all self-hosted ClojureScript environments will now have a first-class eval implementation that just works. For example, Planck master:

$ planck -q
cljs.user=> (eval '(+ 2 3))
5

On the server with tmux

Create a new tmux session:

tmux new-session -s my-session # launch `top`, `htop`, or anything that will regularly updates, then detach

Stream your session:

$ clj -m cljs.main -re graaljs -r
Cloning: https://github.com/clojure/clojurescript
Checking out: https://github.com/clojure/clojurescript at 04e6bd9073daa905543d7decab95a2252c2e53e2
cljs.user=> (.eval js/Polyglot "R" "sum(1:100)")
5050
cljs.user=> (.eval js/Polyglot "ruby" "(1..100).reduce(:+)")
5050
InvalidParameterException: When specifying 'host' or 'bridge' for networkMode, values for 'containerName' and 'containerPort' must be specified from the task definition.

Aws Cognito: Custom Auth (Developer Authenticated Identities)

How to get OpenID Token & IdentityId from AWS Cognito?

  • example: using bash (aws cli sdk)
  • example: using php (aws php sdk v3.*)

note

  • you need to add example.com as custom auth provider in aws console (cognito/federated)