Skip to content

Instantly share code, notes, and snippets.

Jake McCrary jakemcc

Block or report user

Report or block jakemcc

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View 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 Jul 15, 2016
Inspector example for reagent and re-frame
View README.md

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.

View bash function
# 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 Nov 4, 2013
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.
View project.clj
(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 Oct 14, 2012
Set your emacs path from your shell's $PATH
View gist:3887459
(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 Sep 21, 2012
Resharper 7 C# Type Members Layout that gets rid of auto putting sections in regions.
View _readme.txt
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 Jun 6, 2011
pop-up multi-monitor
View gist:1010159
<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>
View gist:226340
// 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 Oct 7, 2009
script to run Clojure
View clj
#!/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 $*
@jakemcc
jakemcc / setup-clojure.sh
Created Oct 7, 2009
Bash script which setups a simple clojure environment in $HOME/opt/clojure
View setup-clojure.sh
#!/usr/bin/env bash
CLOJURE_DIR=$HOME/opt/clojure
JAR_DIR=$HOME/opt/clojure/jars
mkdir -p $CLOJURE_DIR
cd $CLOJURE_DIR
# Get latest version of clojure and compile it
git clone git://github.com/richhickey/clojure.git
cd clojure
You can’t perform that action at this time.