Skip to content

Instantly share code, notes, and snippets.

Avatar

Timothy Baldridge halgari

View GitHub Profile
@halgari
halgari / core.clj
Last active August 29, 2015 14:06 — forked from martinklepsch/core.clj
View core.clj
(ns creator.core
(:require-macros [cljs.core.async.macros :refer [go]])
(:require [om.core :as om :include-macros true]
[cljs.core.async :as async :refer [chan <! >! put!]]
[om-tools.core :refer-macros [defcomponent]]
[cljs.reader :as reader]
[goog.dom :as gdom]
[om-tools.dom :as dom :include-macros true])
(:import [goog.net XhrIo]))
@halgari
halgari / gist:4136116
Created November 23, 2012 15:26 — forked from AlexBaranosky/gist:4134522
doseq-indexed
View gist:4136116
;; Example:
;; (doseq-indexed idx [name names]
;; (println (str idx ". " name)
(defmacro doseq-indexed-functional [index-sym [item-sym coll] & body]
`(doseq [[~item-sym ~index-sym]
(map vector ~coll (range))]
~@body))
View gist:3099717
(defn search-log [log term]
(with-open [rdr (java.io.BufferedReader.
(java.io.FileReader. log ))]
(filter #(not (= -1 (.indexOf % term))
(line-seq rdr))))