This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(alter-var-root #'*out* (constantly *out*)) | |
(alter-var-root #'*err* (constantly *err*)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if curl -s http://169.254.169.254; then # looks like we're running on Amazon. | |
# Install Java | |
apt-get install -y openjdk-7-jre-headless | |
# Install EC2 command-line tools | |
wget https://s3.amazonaws.com/ec2-downloads/ec2-api-tools.zip | |
unzip ec2-api-tools.zip -d /usr/local/ec2 | |
# Set up EC2 environment variables |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'ruby-prof' | |
result = RubyProf.profile do | |
# do something | |
end | |
printer = RubyProf::MultiPrinter.new(result) | |
printer.print(path: ".", profile: "profile") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(declare the-map) | |
(defn the-function | |
[whatever] | |
(whatever the-map)) | |
(def the-map {:foo the-function}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns datomizer.datomize.encode | |
"Encode entities by datomizing their data-structures." | |
(:require [datomic.api :as d :refer [q]] | |
[datomizer.datoms :refer :all] | |
[datomizer.utility.byte-array :refer [byte-array-class]] | |
[datomizer.utility.debug :refer :all] | |
[datomizer.utility.misc :refer [ref-type]])) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns datomizer.datoms | |
"Datom wrangling." | |
(:require [datomic.api :as d] | |
[datomizer.utility.debug :refer [dbg]])) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(@color -> case-eq-default 5 [ 'Green' : 10 ]) | |
initial crumbs [["/"]] | |
locking / | |
-> <@color> = !12[@color] | |
-> <@color> = %a2 | |
-> <@color -> case-eq-default 5 [ 'Green' : 10 ]> = %b3 | |
-> <5> = %b3 | |
-> <5> = (numeric) | |
-> <[ 'Green' : 10 ]> = (list (pair %a2 %b3)) | |
-> <[ 'Green' : 10 ]> = (list %el4) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn show-methods [x] (filter #(not (re-find #"^(__|const)" (str %))) (map :name (:members (clojure.reflect/reflect x))))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun toggle-comment-for-line-or-region (arg) | |
"Make Emacs Alt-/ behave more like RubyMine: toggle comment on region or | |
toggle comment on line (and then move down to next line)." | |
(interactive "*P") | |
(let ((initial-mark-state (and mark-active transient-mark-mode))) | |
(unless initial-mark-state | |
(mark-line)) | |
(comment-or-uncomment-region (region-beginning) (region-end) arg) | |
(unless initial-mark-state | |
(next-line)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(use '[datomic.api :as d :only (db q)]) | |
(clojure.edn/read-string {:readers *data-readers*} "[#db/id[:db.part/db] #db/id[:db.part/db]]") |