Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am jakemcc on github.
  • I am jakemcc (https://keybase.io/jakemcc) on keybase.
  • I have a public key ASCx5MswIKjL2E40s6mZ92Y5_vaFknSQogvXwIaVbmXVPwo

To claim this, I am signing this object:

@jakemcc
jakemcc / weird.clj
Created February 27, 2019 01:32
weird.clj
qqq.core> (require '[clojure.java.shell :as shell])
nil
;; Kick off a future that is reading System/in and just print the result
qqq.core> (future
(println (.read System/in))
(println "done"))
#<Future@536d8f5e: :pending>
;; Invoke something that uses /bin/sh, see the output
@jakemcc
jakemcc / README.md
Created July 15, 2016 17:22
Inspector example for reagent and re-frame

inspector.cljs

root function is what gets added to our markup for the page. q/db is a query that just returns our entire re-frame db.

inspector.scss

Some example styling for the inspector.

# one line for easy copy and pasting to terminal.
function newyezzy { curl -s http://newyeezyresolutions.com/randquote.php?quote=$1 | sed 's/.*\<h2>\(.*\)<.*<div id="sourceinfo".*/\1/' | head -n 1; }
@jakemcc
jakemcc / project.clj
Created November 4, 2013 00:35
Modified https://github.com/bitemyapp/revise/blob/master/project.clj to work with lein-test-refresh. `lein-protobuf` depends on an old version of `leinjacker` which has too strict of constraints for modern Leiningen versions.
(defproject revise "0.0.2"
:description "RethinkDB client for Clojure"
:url "github.com/bitemyapp/revise/"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:main bitemyapp.revise.core
:plugins [[lein-protobuf "0.3.1" :exclusions [leinjacker]]
[lein-difftest "2.0.0"]
[com.jakemccrary/lein-test-refresh "0.1.2"]]
:test-selectors {:default (fn [_] true) ;; (complement :integration)
@jakemcc
jakemcc / gist:3887459
Created October 14, 2012 05:17
Set your emacs path from your shell's $PATH
(defun set-exec-path-from-shell-PATH ()
(let ((path-from-shell (shell-command-to-string "$SHELL -i -c 'echo $PATH'")))
(setenv "PATH" path-from-shell)
(setq exec-path (split-string path-from-shell path-separator))))
(if window-system (set-exec-path-from-shell-PATH))
@jakemcc
jakemcc / _readme.txt
Created September 21, 2012 13:57
Resharper 7 C# Type Members Layout that gets rid of auto putting sections in regions.
Having Resharper auto put code into #regions is annoying.
To stop this, open Resharper options, then C# > Type Members Layout.
Uncheck "Use Default Patterns" and past xml into it.
@jakemcc
jakemcc / gist:1010159
Created June 6, 2011 12:28
pop-up multi-monitor
<html>
<head></head>
<body>
<input type="button" onclick="window.open(location.href,'myWindow','height=300,width=300,menubar=no,status=no,left=3000').focus();return false;" value="Try it">
</body>
</html>
// No issues with this
private static class DecimalsRecordLayout extends CobolRecordLayout {
public DecimalsRecordLayout() {
super("decimals");
field("Price", "9(5)");
field("Quantity", "99v999");
field("Other", "999v99");
}
}
@jakemcc
jakemcc / clj
Created October 7, 2009 01:29
script to run Clojure
#!/usr/bin/env bash
java -cp $HOME/opt/clojure/jars/jline.jar:$HOME/opt/clojure/jars/clojure-contrib.jar:$HOME/opt/clojure/jars/clojure.jar jline.ConsoleRunner clojure.main $*