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
provider "xenserver" { | |
url = "https://xxx.xxx.xxx.xxx" | |
username = "root" | |
password = "" | |
} | |
# resource "xenserver_vm" "test1" { | |
# base_template_name = "sample-template" | |
# name_label = "test1" | |
# static_mem_min = 2147483648 |
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 bb | |
(ns switch | |
(:require [clojure.pprint :as pprint])) | |
(defn project-clj-map [filename] | |
(->> (slurp filename) | |
(read-string) | |
(drop 1) | |
(partition 2) | |
(map vec) |
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 bb | |
;; 0. run using 1Password CLI "op inject -i docker-credentials-1password -o docker-credentials-1password" to replace | |
;; reference to op://Personal/1P token/credential with real 1Password Connect token. | |
;; http://onepasswordconnect.local/v1/vaults/vault_uuid/items/item_uuid should point to your 1Password Connect, vault and item with AWS credentials. | |
;; 1. save to /usr/local/bin/docker-credentials-1password; | |
;; 2. install babashka from http://babashka.org | |
;; 3. create /etc/docker/config.json | |
;; { "credsStore": "1password" } | |
;; 4. install docker-credentials-ecr-login from https://github.com/awslabs/amazon-ecr-credential-helper | |
;; 5. docker pull xxxxxxxxxxxxx.dkr.ecr.eu-central-1.amazonaws.com/my-great-repo should just work now! |
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
(def now (java.time.LocalDateTime/now)) | |
(-> now | |
(.with (java.time.temporal.TemporalAdjusters/firstDayOfMonth)) | |
(.with (java.time.LocalTime/MIN))) | |
(-> now | |
(.with (java.time.temporal.TemporalAdjusters/lastDayOfMonth)) | |
(.with (java.time.LocalTime/MAX))) |
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
;; CREATE TABLE `station` ( | |
;; `id` int(11) NOT NULL AUTO_INCREMENT, | |
;; `location` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, | |
;; PRIMARY KEY (`id`) | |
;; ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; | |
;; CREATE TABLE `rental_order` ( | |
;; `id` int(11) NOT NULL AUTO_INCREMENT, | |
;; `campervan_id` int(11) NOT NULL, | |
;; `start_station_id` int(11) NOT NULL, | |
;; `end_station_id` int(11) NOT NULL, |
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
Vagrant.configure("2") do |config| | |
## VM for target deployments | |
config.vm.define "target", autostart: false do |target| | |
target.vm.box = "centos/7" | |
target.vm.network "forwarded_port", guest: 8000, host: 8000 | |
target.vm.network "private_network", ip: "10.10.50.3" | |
target.vm.provider "virtualbox" do |vb| | |
vb.memory = "512" | |
end | |
#target.vm.synced_folder "../target_home_folder", "/home/vagrant/target" |
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
(extend-protocol clojure.core.protocols/Datafiable | |
datomic.query.EntityMap | |
(datafy [o] (into {} o))) | |
(extend-protocol clojure.core.protocols/Navigable | |
datomic.query.EntityMap | |
(nav [coll k v] | |
(clojure.datafy/datafy v))) |
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
(require '[cognitect.rebl]) | |
(cognitect.rebl/ui) | |
(add-tap #'cognitect.rebl/submit) | |
(tap> [1 2 3]) |
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
(def get-account | |
(interceptor/handler | |
(fn [{db :db user-id :user/id}] | |
(let [pull-exp [::account/id | |
::account/balance | |
{::account/currency [::currency/name | |
::currency/minor-unit | |
::currency/description]}]] | |
(ok | |
(-> |
NewerOlder