Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Memo mainly for me. | |
If you would like to catch x-http-method-override, then do you need to write one like this ring case: | |
;from https://github.com/ithaka/artstor-group-service-os/blob/d1251094c8f583ddc9611ace9a6c20d57dd858dc/src/artstor_group_service/util.clj | |
(defn wrap-method-override | |
"Ring middleware for method overriding (X-HTTP-Method-Override)" | |
[handler] | |
(fn [req] |
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
[Unit] | |
Description=clojure SERVER service | |
After=network.target | |
StartLimitIntervalSec=0 | |
[Service] | |
Type=simple | |
Restart=always | |
RestartSec=10 | |
ExecStart=/home/ubuntu/adopt-jdk/jdk-11.0.13+8/bin/java -jar /home/ubuntu/app.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
(ns playground | |
(:require [libpython-clj2.python :as py] | |
[libpython-clj2.require :refer [require-python]])) | |
(require '[libpython-clj2.python | |
:refer [as-python as-jvm | |
->python ->jvm | |
get-attr call-attr call-attr-kw | |
get-item | |
initialize! |
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 | |
### provision sh HU for vmware or vagrant | |
### partially "stolen" from Krisztian/ DevopsAcademy | |
### System | |
debconf-set-selections <<EOF | |
locales locales/locales_to_be_generated multiselect en_US.UTF-8 UTF-8, hu_HU.UTF-8 UTF-8 | |
locales locales/default_environment_locale select C.UTF-8 | |
debconf debconf/priority select critical |
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
shadow-cljs release app | |
expo build:ios -t archive | |
eas submit --platform ios --url {{app S3 location from buid}} |
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
; define function with tryfn (defn+try-catch+meta) | |
=> #'microscope.monitor/tryfn<> | |
(tryfn<> | |
he [x y] (+ x y)) | |
=> #'user/he | |
; send data to Sentry etc | |
(he 2 "a") |
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
;; https://gist.github.com/ericnormand/d744381a3a625af105245fe5f9ecc942 | |
;; eric normand | |
(swap "abc" "a" "b") ;=> "bac" | |
(swap "book" "k" "t") ;=> "boot" | |
(swap "Closure" "j" "s") ;=> "Clojure" | |
(swap "bee" "b" "e") ;=> "ebb" |
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 data [1 2 3 4 3 4 3 4 5 6 7]) | |
(defn -vec-frequencies [] | |
(fn [acc v] | |
(let [index (.indexOf acc v) | |
curr-count (if (pos? index) | |
(first (get acc (inc index))) | |
0)] | |
(if (zero? curr-count) | |
(conj acc v [1]) |
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
; Partition by "identity" | |
(def sdta [1 1 2 2 3 3 2 3 4 4]) | |
(if (= (last (flatten sdata)) 3) | |
(conj (pop sdata) (conj (peek sdata) 4)) | |
(conj sdata [3])) | |
(defn -partition-by [] | |
(fn [acc v] |
NewerOlder