Skip to content

Instantly share code, notes, and snippets.

View andreivolt's full-sized avatar

Andrei Volt andreivolt

View GitHub Profile
#!/usr/bin/env sh
url=$1
start=$2 end=$3
noverbose='-hide_banner -loglevel error'
ffmpeg \
$noverbose \
#!/usr/bin/env bb
(require '[clojure.java.io :as io])
(require '[babashka.process :refer [process]])
(def f (io/file "/tmp/colortemp"))
(def MAX 6500)
(def MIN 1000)
(def INCR 100)
### Keybase proof
I hereby claim:
* I am andreivolt on github.
* I am andreivolt (https://keybase.io/andreivolt) on keybase.
* I have a public key ASAxJdnYQ3o1GxSg32G9DOG8VMFNAXEikp-e2ZwTUCyBMwo
To claim this, I am signing this object:
@andreivolt
andreivolt / datomic-edn-handlers.clj
Created August 5, 2021 18:21 — forked from favila/datomic-edn-handlers.clj
Utilities for making it easier to read edn files. Also includes tag readers that datomic uses.
(ns favila.read-edn.tag-readers
"Common tag-reader maps for edn."
(:require datomic.db
datomic.function
datomic.codec)
(:import java.net.URI))
(defmethod print-method URI [^URI x ^Writer w]
(doto w
(.write "#uri ")
@andreivolt
andreivolt / map-to-html.clj
Created August 5, 2021 21:04 — forked from semperos/map-to-html.clj
Function using hiccup to print a Clojure map as a "nested" HTML list.
(def example-map
{:a "foo" :b "bar" :other-stuff
{:item-1 ["hello" "clojure"],
:item-2 ["hello" "hiccup"],
:another-map
{:x "foo" :y "bar" :z "baz"}}
:c "wowza sauce"})
(defn map-to-html-list
"Clojure map to nested HTML list. Optional list-type and wrapper params taken as keywords hiccup understands, and optional sep parameter for the string to show key-value associations"
jo \
input=$(jo text="$*") \
voice=$(
jo \
languageCode=en-us \
name=en-US-Wavenet-C \
ssmlGender=FEMALE) \
audioConfig=$(jo audioEncoding=OGG_OPUS) \
| http https://texttospeech.googleapis.com/v1beta1/text:synthesize key==$GCLOUD_API_KEY \
| jq -r .audioContent \
#! /usr/bin/env nix-shell
#! nix-shell -i bash -p graalvm11-ce babashka clojure jo
usage() {
cat <<EOF
build native binaries for Clojure using GraalVM
Usage: ${0##*/} extra_deps entrypoint java_reflection_classes
Example: ${0##*/} 'org.clojure/tools.deps.alpha {:mvn/version "0.12.1003"}' find-deps.core java.io.PushbackReader java.io.OutputStreamWriter
EOF
#! /usr/bin/env nix-shell
#! nix-shell -i bb -p graalvm11-ce babashka clojure
(require '[clojure.java.io :as io]
'[clojure.java.shell :refer [sh]]
'[cheshire.core :as json] ; only for eval in editor
'[clojure.edn :as edn]
'[clojure.string :as s]
'[clojure.tools.cli :refer [parse-opts]])
@andreivolt
andreivolt / track
Last active January 20, 2022 20:01
track shipments with Aftership
#!/usr/bin/env bash
jo direct_trackings=$(jo -a $(jo tracking_number=$1)) \
| http https://track.aftership.com/api/v2/direct-trackings/batch \
| jq -r '
.data.direct_trackings
| first
| .tracking.checkpoints[]
| [
(
@andreivolt
andreivolt / convert.clj
Created February 23, 2024 00:19 — forked from KGOH/convert.clj
convert.clj -- babashka edn/json/yaml to edn/json/yaml converter
#!/usr/bin/env bb
;; convert.clj -- babashka edn/json/yaml to edn/json/yaml converter
;; Author: github.com/KGOH/
;; Source: gist.github.com/KGOH/50c0f66022fea2ac173518a143238058
;; Version: 2020.4
; Usage example:
; In Emacs: i.imgur.com/TIEDmga.mp4
; $ convert.clj edn <<< '{"foo": "bar"}'
; {:foo "bar"}