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
(fn atom (v) {"v" v}) | |
(fn deref (atm) (:atm "v")) | |
(fn reset! (atm newv) | |
(= (:atm "v") newv) | |
(deref atm)) | |
(fn swap! (atm f) | |
(reset! atm (apply f [(:atm "v")]))) |
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 'lib/rns' | |
require 'lib/dbutil' | |
Db = Rns(DbUtil => [:with_statement, :fetch_all]) do | |
def get_list(conn, shortcode) | |
sql = <<EOS | |
SELECT todo, state | |
FROM todos t INNER JOIN lists l | |
ON t.list_id = l.id | |
WHERE l.id=? |
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 | |
TARGET="alan@telavant.com:/www/todoshark.com/subdomains/dev/" | |
rsync -vv -a . $TARGET | |
inotifywait -r -m -e close_write --format '%w%f' . | while read F; do | |
echo "sending $F" | |
scp "$F" "${TARGET}/${F}" | |
done |
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
class Symbol | |
def ~@ | |
method(self) | |
end | |
end | |
def inc(n) | |
n + 1 | |
end |
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
#!/usr/bin/ruby | |
require 'rubygems' | |
Gem.use_paths(nil, Gem.path << "/home/alan/.gem/gems") | |
require 'bundler' | |
require 'rack' | |
require 'app' | |
Rack::Handler::CGI.run App.new |
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
fakegen.core> (doseq [x (repeatedly 100 company/bs)] (println x)) | |
mesh best-of-breed bandwidth | |
monetize user-centric content | |
scale global partnerships | |
streamline 24/7 web services | |
matrix collaborative e-business | |
utilize enterprise bandwidth | |
benchmark out-of-the-box users | |
iterate cross-platform communities | |
matrix efficient relationships |
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
(defmacro with-ns [sym & body] | |
`(binding [*ns* (create-ns '~sym)] | |
(refer-clojure) | |
~@(for [form body] `(eval '~form)))) |
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
user> (shuffle (range 10)) | |
[0 7 3 1 9 8 6 2 5 4] | |
user> (doseq [n *1] (future (Thread/sleep (* 1000 n)) (println n))) |
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
(set-env! :dependencies '[[alandipert/hyperturbo "0.0.1-SNAPSHOT"]]) | |
(require '[alandipert.hyperturbo :refer [TURBO GOTO]]) | |
(TURBO | |
10 (println "Docker boot hahahaha!") | |
20 (GOTO 10)) |
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
;;; javelin input cell | |
(def n (cell 0)) | |
;;; javelin formula cell | |
(def n*5 (cell= (* n 5))) | |
;;; reagent atom "slaved" to n*5 | |
(def count (r/atom nil)) | |
(cell= (swap! count assoc :count n*5)) |