Skip to content

Instantly share code, notes, and snippets.

View AlexBaranosky's full-sized avatar

AlexBaranosky AlexBaranosky

  • Cisco Secure Malware Analytics (formerly Threat Grid)
  • Massachusetts
  • 01:16 (UTC -04:00)
View GitHub Profile
@AlexBaranosky
AlexBaranosky / threatgrid_job_listing.md
Last active December 18, 2017 23:57
threatgrid_job_listing.md

[ Full disclosure: I am the technical lead on this product and the hiring manager in this case. Feel free to contact me with questions, and to pass this around. ]

Clojure Developer for Malware Analysis Product

The ThreatGRID team at Cisco is looking for experienced clojure developers to work on our large scale, malware analysis product. Our entire platform is built on Clojure, from the the API services, around the event processing subsystem, and down to the core.logic analysis engine.

Our system runs as a distributed cluster in the cloud, and shrunk down to a

(clojure.core/getLookupThunk
[this__6431__auto__ k__6432__auto__]
(let [gclass (class this__6431__auto__)]
(case
k__6432__auto__
:events2
(reify
clojure.lang.ILookupThunk
(get
[thunk gtarget]
@AlexBaranosky
AlexBaranosky / gist:4134522
Created November 23, 2012 08:27
doseq-indexed
;; Example:
;; (doseq-indexed idx [name names]
;; (println (str idx ". " name)
(defmacro doseq-indexed [index-sym [item-sym coll] & body]
`(let [idx-atom# (atom 0)]
(doseq [~item-sym ~coll]
(let [~index-sym (deref idx-atom#)]
@AlexBaranosky
AlexBaranosky / gist:7620985
Created November 23, 2013 22:46
Amethyst + Emacs
"increase-main": {
"mod": "mod1",
"key": "="
},
"decrease-main": {
"mod": "mod1",
"key": "-"
},
@AlexBaranosky
AlexBaranosky / gist:bdf9a25ecaf5162a6529
Last active March 3, 2016 23:55
remove scientific notation for floats
(defn drop-trailing-zeros [^String s]
(.replaceFirst s "\\.0*$|(\\.\\d*?)0+$" "$1"))
(defmethod print-method Number [o, ^Writer w]
(if (float? o)
(.write w (drop-trailing-zeros (format "%.99f" o)))
(.write w (str o))))
(require '[clojure.java.io :as io]
'[incanter.stats :as stats])
(import '[cern.colt.list.tdouble DoubleArrayList])
(defn rpt [xs]
(mapv vector
["Min" "10%" "20%" "30%" "40%" "50%"
"60%" "70%" "80%" "90%" "99%" "99.5%" "99.9%" "Max"]
(stats/quantile xs
:probs (DoubleArrayList.
gui.internal.parser> (def env (aj/empty-env))
#'gui.internal.parser/env
gui.internal.parser> (aj/analyze '(println "!") env)
{:ret-tag java.lang.Object, :children [:args :fn], :meta {:line 1, :column 14}, :op :invoke, :form (println "!"), :env {:file "NO_SOURCE_PATH", :line 1, :column 14, :loop-locals [], :context :expr, :ns gui.internal.parser}, :fn {:id 0, :arglists ([& more]), :form println, :env {:file "NO_SOURCE_PATH", :loop-locals [], :context :expr, :ns gui.internal.parser}, :op :var, :assignable? false, :var #'clojure.core/println}, :args [{:id 1, :tag java.lang.String, :op :const, :env {:file "NO_SOURCE_PATH", :loop-locals [], :context :expr, :ns gui.internal.parser}, :type :string, :literal? true, :val "!", :form "!"}]}
gui.internal.parser> (def pp clojure.pprint/pprint)
#'gui.internal.parser/pp
gui.internal.parser> (pp (aj/analyze '(println "!") env))
{:ret-tag java.lang.Object,
:children [:args :fn],
:meta {:line 1, :column 18},
if rvm version >/dev/null 2>&1; then
SELECT_RUBY="rvm use system" ## 'system' is the important piece
SUDO_GEM=""
else
SELECT_RUBY="date"
SUDO_GEM="sudo"
fi
(defn- expand-arg [arg]
(if (symbol? arg)
arg
(first (single-destructuring-arg->form+name arg))))
(defn print-and-return
"Diagnostic tool for printing the result of evaluating an s-expression.
Any initial args over 1, are printed as strings, and generally used as a label."
[& xs]
(when (seq (butlast xs))
;; works, but only for already opened buffers
(defun projectile-cleanup-project-buffers ()
(interactive)
(dolist (buffer (projectile-project-buffer-names))
(condition-case nil
(with-current-buffer buffer
(esk-cleanup-buffer))
(buffer-read-only nil))))
;; doesn't work - intended to get it to run against all