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
;;with adv. optimizations on my macbook air | |
(ns foo | |
(:require [datascript :as d])) | |
(d/q '[:find (sum ?x) | |
:with ?idx | |
:in [[?idx ?x]]] | |
(map-indexed vector (range 10000))) | |
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
module Saucelabs | |
SAUCE_USERNAME = '' | |
SAUCE_TOKEN = '' | |
def self.setup_saucelabs_connection!(driver=nil) | |
WebMock.allow_net_connect! | |
driver ||= { | |
capability: :chrome, | |
platform: 'Windows 8', | |
version: '', |
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
#!/bin/bash | |
set -e | |
lein uberjar | |
rsync target/weathertron.jar weathertron@weathertron:. | |
ssh root@weathertron svc -t /etc/service/weathertron |
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 cider-send-dwim (arg) | |
"Send the appropriate forms to the REPL to be evaluated." | |
(interactive "P") | |
(let ((expr (cider-last-sexp))) | |
(set-buffer (cider-current-repl-buffer)) | |
(unless (eq (current-buffer) (window-buffer)) | |
(pop-to-buffer (current-buffer) t)) | |
(goto-char (point-max)) | |
(insert expr) | |
(cider-repl-return) |
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
;;Export datoms, replacing eids w/ tempids so that the datoms can be imported into a second datascript/datomic db. | |
(let [db (d/db conn) | |
eids (->> (d/q '{:find [?eid] | |
:in [$ %] | |
:where [(exportable ?eid)]} | |
db export-rules) | |
(map first) | |
set) |
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
#I'm using two non-standard packages; one for nearest neighbors (FNN) and one for doing split-combine-apply (think map reduce) type operations. | |
#you'll have to run this: install.packages(c('FNN', 'plyr')) | |
#you can also checkout documentation in R using the question mark; run this: ?knn | |
library(FNN) | |
library(plyr) | |
#Here are some random points on the plane to show you the interface | |
neartop = ldply(1:50, function(i){ | |
c( x = rnorm(1) | |
, y = 1 + rnorm(1, sd=0.5)) |
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
Things I don't particularly like about Devin Chalmers: | |
1. He doesn't write any tests before implementing John Conway's Game of Life. | |
2. He asks for whiskey with lots of different, non-whiskey things mixed in. | |
3. He put a second top tube on his bicycle and then stopped riding it. | |
4. Looks better in a pair of brass goggles than I do. |
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
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
;;/login.html (a static resource) does not work in [compojure "0.6.0-RC4"] | |
;;however, the simple GET works fine | |
;; 2011-02-12 08:03:25.840:WARN::/login.html | |
;; java.lang.NullPointerException | |
;; at ring.middleware.session$wrap_session$fn__3069.invoke(session.clj:47) | |
;; at ring.middleware.cookies$wrap_cookies$fn__3009.invoke(cookies.clj:132) | |
;; at clojure.lang.Var.invoke(Var.java:365) | |
;; at ring.adapter.jetty$proxy_handler$fn__2063.invoke(jetty.clj:16) | |
;; |
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
\documentclass[a4paper,11pt,leqno,article,oneside]{memoir} | |
\usepackage[leqno]{amsmath} | |
\usepackage{amsfonts} | |
\begin{document} | |
\title{Test Document} | |
\chapter{Clustering} |
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
<!DOCTYPE html> | |
<head> | |
<meta charset='utf-8'> | |
</head> | |
<body> | |
<h1>Original Page content</h1> | |
<p>blah blah blah</p> | |
<div id='my_pubtex'></div> | |
</body> | |
<script src='//ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.js'></script> |
OlderNewer