- commutativity
- associativity
- map
- monad & functor laws
- serialization/deserialization
At Skimlinks up until about 20 months ago our service monitoring consisted mostly of Icinga/Nagios checks that only ran about every 5 minutes. The Icinga dashboard was displayed on our monitor wall. While readying the release of a new version of SkimWords we thought we needed some monitoring closer to real-time. Since the API was CPU bound and latency sensitive we needed more insight into the state of the system, especially during new releases and traffic spikes.
As Clojure fans, we had recently come across
(ns user | |
(:require [babashka.fs :as fs] | |
[clojure.java.shell :refer [sh]] | |
[clojure.string :as str] | |
[clojure.tools.cli :refer [parse-opts]])) | |
(def allowed-files | |
#{"envrc" "shell.nix" "justfile" "Makefile"}) | |
(def mappings |
/* JSON-Websocket-AMQP bridge */ | |
var amqp_ws = function() { | |
ws = null; | |
function recieve_amqp(args) { | |
console.log(args.msg); | |
}; | |
import logging | |
import json | |
import argparse | |
import requests | |
github_base = "https://api.github.com" | |
github_status_url = github_base + "/repos/{repo_name}/statuses/{sha}?access_token={token}" | |
token = '' |
(defn passes-monoid-props | |
[f id a b c] | |
(and (= (f (f a b) c) (f a (f b c))) ;; associativity | |
(= (f a id) a) ;; identity element | |
(= (f id a) a))) | |
(defspec plus-zero-are-monoid 100 | |
(prop/for-all [[a b c] (gen/vector gen/int 3)] | |
(passes-monoid-props + 0 a b c))) |
(require 'package) | |
(add-to-list 'package-archives '("marmalade" . "http://marmalade-repo.org/packages/")) | |
(add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/")) | |
(package-initialize) | |
;; minimally, install use-package | |
(unless (package-installed-p 'use-package) | |
(package-refresh-contents) | |
(package-install 'use-package)) |
#!/usr/bin/env bash | |
# check formatting of clj files changed from master | |
lein cljfmt check $(git diff --name-only origin/master | | |
grep "\\.clj[sc]\\?$" | | |
paste -s -d" ") |
(import | |
'[java.time ZonedDateTime] | |
'[java.time.format DateTimeFormatter]) | |
(.. (ZonedDateTime/now) (format DateTimeFormatter/ISO_INSTANT)) |
;; Copyright (c) James Reeves. All rights reserved. | |
;; The use and distribution terms for this software are covered by the Eclipse | |
;; Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) which | |
;; can be found in the file epl-v10.html at the root of this distribution. By | |
;; using this software in any fashion, you are agreeing to be bound by the | |
;; terms of this license. You must not remove this notice, or any other, from | |
;; this software. | |
(ns compojure.server.jetty | |
"Clojure interface to start an embedded Jetty server." |