View Dockerfile
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
FROM alpine:3.11.3 | |
RUN apk update && apk add curl ca-certificates unzip && rm -rf /var/cache/apk/* | |
RUN curl -L 'https://github.com/babashka/babashka/releases/download/v0.2.10/babashka-0.2.10-linux-static-amd64.zip' -o /tmp/bb.zip && \ | |
unzip /tmp/bb.zip && \ | |
mv bb /usr/bin/bb && \ | |
chmod +x /usr/bin/bb | |
RUN mkdir -p /app |
View start-jar
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 bash | |
set -oe pipefail | |
jarPath=$1 | |
# inspired by metabase | |
# Disable limit to amount of time spent in GC. Better slow than not working at all | |
JAVA_OPTS="$JAVA_OPTS -XX:-UseGCOverheadLimit" | |
JAVA_OPTS="$JAVA_OPTS -XX:+UseConcMarkSweepGC" |
View graleph error.txt
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
# - ubuntu : cd tmp/graleph/ | |
# master - graleph : make run | |
docker run --net host --rm -it graleph:latest | |
date=2020-06-12 00:22:16,451 level=INFO thread=main ns=graleph.core message=starting | |
date=2020-06-12 00:22:16,523 level=INFO thread=clojure-agent-send-off-pool-0 ns=graleph.core message=[] | |
Exception in thread "main" java.lang.IllegalArgumentException: Class NioDatagramChannel does not have a public non-arg constructor | |
at io.netty.channel.ReflectiveChannelFactory.<init>(ReflectiveChannelFactory.java:36) | |
at io.netty.bootstrap.AbstractBootstrap.channel(AbstractBootstrap.java:110) | |
at aleph.udp$socket.invokeStatic(udp.clj:51) | |
at graleph.core$start.invokeStatic(core.clj:21) |
View Makefile
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
.ONESHELL: | |
test: .SHELLFLAGS := -i | |
test: SHELL := bb | |
test: | |
(println :wow) | |
(require '[clojure.string :as s]) | |
(s/reverse (slurp "./Makefile")) | |
View ex.tf
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
variable "env_map" { | |
default = { | |
PG_HOST = "some.host.internal" | |
SOME_SECRET = "pineapples are 1337" | |
} | |
} | |
variable "port" { | |
default = 1234 |
View service.tf
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
module "something" { | |
source = "./modules/service_v1" | |
name = "bananas" | |
image = "repo/image:tag" | |
network_mode = "host" | |
environment = { | |
PORT = 3032, | |
PG_HOST = module.pg.fqdn, | |
SOME_SECRET = module.secrets["some_sekrit"].value, | |
} |
View container.yml
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
- name: Something | |
docker_container: | |
name: bananas | |
image: repo/image:tag | |
network_mode: host | |
environment: | |
PORT: 3032 | |
PG_HOST: pg.internal | |
SOME_SECRET: "{{ sekrit_var }}" | |
View iffff.clj
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
(if thing | |
thing-if-true | |
(when otherwise-thing | |
one-more-thing-if-true)) |
View rec.clj
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
user=> (defrecord Foo [foo bar]) | |
user.Foo | |
user=> (def f (->Foo :foo :bar)) | |
#'user/f | |
user=> (defrecord Qux [foo bar baz]) | |
user.Qux | |
user=> (def q (map->Qux (select-keys f [:foo :bar]))) | |
#'user/q | |
user=> (clojure.pprint/pprint q) | |
{:foo :foo, :bar :bar, :baz nil} |
View sigh.rb
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
class SomeDataThing < OpenStruct | |
include ActiveModel::Validations | |
validates :name, presence: true | |
validates :email, presence: true | |
end | |
SomeDataThing.new(name: "I'm tired").valid? # => false |
NewerOlder