Skip to content

Instantly share code, notes, and snippets.

View ignorabilis's full-sized avatar

Irina Yaroslavova Stefanova ignorabilis

View GitHub Profile
@ignorabilis
ignorabilis / env-vars-medium.clj
Last active October 2, 2023 08:27
Env vars in Clojure
;; overly simplified, but you get the idea
(def parameters
[:something-something
:another-something])
(def secrets
[:secret-secret
:very-secret])
@ignorabilis
ignorabilis / env-vars-medium.tf
Last active October 2, 2023 08:28
Env vars in Terraform
container_definitions = [
{
name = "my-container"
image = "my-image"
//---------- no longer needed ----------
environment = [
{
"name" : "SOMETHING_SOMETHING",
"value" : var.something_something
@ignorabilis
ignorabilis / any_api.clj
Created June 9, 2023 06:41
Declaratively define endpoints
(def api-defs
{:moogle
{:base-url "https://moogle.com"
:endpoints {:endpoint-a
{:method :post
:path ["/a/b/:id"]
:custom-headers-def {:header/X-cb-something-something :required}}}}})
(defn construct-headers [custom-headers-def custom-headers]
(reduce
@ignorabilis
ignorabilis / box_unbox.clj
Last active June 9, 2023 07:10
Haskell inspired way of boxing/unboxing, useful for testing
(ns playground.response)
(defn ok [value]
{:http-status 200
:value value})
(ns playground.box-unbox)
(defn -->
"Used to box a side effectful function with some of its values that can be
### Keybase proof
I hereby claim:
* I am ignorabilis on github.
* I am ignorabilis (https://keybase.io/ignorabilis) on keybase.
* I have a public key ASBOL-4qvH-adQuvTnlW6rpRjsw2rAOizV4k4lbWKbBbzgo
To claim this, I am signing this object:
@ignorabilis
ignorabilis / index.html
Created October 17, 2017 13:32
Explore D3 - line chart
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/4.2.3/d3.min.js"></script>
<script src="https://d3js.org/d3-selection-multi.v1.min.js"></script>
@ignorabilis
ignorabilis / index.html
Last active October 17, 2017 13:30
Explore D3 - range chart
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/4.2.3/d3.min.js"></script>
<script src="https://d3js.org/d3-selection-multi.v1.min.js"></script>
@ignorabilis
ignorabilis / index.html
Last active October 17, 2017 13:30
Explore D3 - working with simple data
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/4.2.3/d3.min.js"></script>