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
// xcrun -sdk macosx swiftc pbpaste.swift -o pbpaste-html | |
// from: http://stackoverflow.com/questions/17217450/how-to-get-html-data-out-of-of-the-os-x-pasteboard-clipboard | |
import Cocoa | |
let type = NSPasteboard.PasteboardType.html // PNG for image | |
if let string = NSPasteboard.general.string(forType: type) { | |
print(string) | |
} else { | |
print("Could not find string data of type '\(type)' on the system pasteboard") | |
exit(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
#!/usr/bin/env python3 | |
"""Converts JSON objects into nix (hackishly).""" | |
import sys | |
import json | |
import re | |
INDENT = " " * 2 |
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
/.mypy_cache/ | |
/.envrc |
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 | |
;; 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"} |
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 | |
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[] | |
| [ | |
( |
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 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]]) |
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 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 |
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
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 \ |
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 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" |
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 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 ") |
NewerOlder