Instantly share code, notes, and snippets.

View .circle.yml
version: 2
- image: circleci/clojure:lein-2.7.1
- CC_TEST_REPORTER_ID=....set in project settings....
View app-project.clj
(defproject some-app "0.1.0"
:description "FIXME: write description"
:url ""
:license {:name "Eclipse Public License"
:url ""}
:repositories [["bintray"
{:url ""
:snapshots true
:username :env/bintray_username
:password :env/bintray_api_key}]]
View lib-project.clj
(defproject some-lib "0.1.0"
:description "FIXME: write description"
:url ""
:deploy-repositories [["releases"
:sign-releases false
:username :env/bintray_username
:password :env/bintray_api_key}]
View receiver.clj
(import '( DatagramSocket DatagramPacket))
(def socket (DatagramSocket. 5200))
(def running (atom true))
(def buffer (make-array Byte/TYPE 1024))
(defn parse [packet]
(println (String. (.getData packet) 0 (.getLength packet))))
(defn start-receiver []
View aleph.proxy.clj
(require '[aleph.http :as http])
(require '[ring.middleware.cookies :as cookies])
;; serv is a component which wraps aleph.http.server creation/teardown
(def ECHO (component/start (serv/create "ECHO" {:port 3037
:handler (fn [req]
(log/info req)
{:status 200 :body "ok" })})))
#!/usr/bin/env bash
# Enable SOCKS tunnel for given interface, ssh to a remote machine
# and open a SOCKS proxy.
# When cancelled it will disable proxy settings for given interface
# Start with sudo if you want it to modify all settings for you
# or just run to be prompted on all settings changes
user= # ssh user
host= # ssh host
jq -r '(map(keys) | add | unique) as $cols | map(. as $row | $cols | map($row[.])) as $rows | $cols, $rows[] | @csv' team.json > foo.csv
View temp-files.clj
(defn create-tmp-file
"Create tmp file. Return path to the file!
Note file is deleted when JVM terminates"
[prefix suffix]
(let [file (File/createTempFile prefix suffix)]
(.deleteOnExit file)
(.getPath file)))
(defn create-tmp-directory
import requests
import json
auth = 'Token <your token>'
payload = [
'source': "L. Ritchie",
'content': [
View tr.js
function add1(arg) {
return arg + 1;
function sub2(arg) {
return arg - 2
function add1ToColl(coll) {