View app-project.clj
(defproject some-app "0.1.0"
:description "FIXME: write description"
:url "http://example.com/FIXME"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:repositories [["bintray"
{:url "https://fruit.bintray.com/bananas"
: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 "http://example.com/FIXME"
:deploy-repositories [["releases"
{:url
"https://api.bintray.com/maven/fruit/bananas/some-lib/;publish=1"
:sign-releases false
:username :env/bintray_username
:password :env/bintray_api_key}]
["snapshots"
View receiver.clj
(import '(java.net 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" })})))
View socks.sh
#!/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 socks.sh if you want it to modify all settings for you
# or just run socks.sh to be prompted on all settings changes
user= # ssh user
host= # ssh host
View woah.sh
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
View nomnom-api.py
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) {
View node.sh
nodeProg=$(which node)
if [[ "$nodeProg" = "" ]] ; then
nodeProg=$(which nodejs)
fi