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
def get_if_related_to(id, relationship) do | |
table("people") |> filter(lambda fn (person) -> | |
case relationship do | |
r when r in [:brother, :sister] -> | |
person[:siblings] |> contains(id) | |
r when r in [:mother, :father] -> | |
person[:children] |> contains(id) | |
r when r in [:son, :daughter] -> | |
table("people") | |
|> get(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
(ns clj-lmdb.core | |
(:refer-clojure :exclude [get]) ; suppress the shadowing warning | |
(:require [clojure.core :as core]) | |
(:import [org.fusesource.lmdbjni Database Env] | |
[org.fusesource.lmdbjni Constants])) | |
(declare ^:dynamic *txn*) | |
(declare ^:dynamic *db*) | |
(defprotocol LMDB |
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
(def open-for-discussion? (atom true)) | |
(def discussion-count (agent 0)) | |
(def discussion-board (ref [])) | |
(def discussion-board-count 3) | |
(defn open-discussion [duration] | |
(do (Thread/sleep duration) (swap! open-for-discussion? not))) | |
(defn add-discussion [] | |
(future |
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 citus-byte) | |
(defn flatten2 | |
{:static true} | |
[x] | |
(letfn [(flat [coll] | |
(lazy-seq | |
(when-let [c (seq coll)] | |
(let [x (first c)] | |
(if (sequential? x) | |
(concat (flat x) (flat (rest c))) |
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 webstore.simplecart_parser | |
(:require [clojure.string :as string])) | |
;; see github.com/sventech/simplecart-js for tax calculation improvement fork | |
(def input-params | |
{"item_quantity_1" "1", | |
"itemCount" "2", | |
"item_price_1" "9.99", | |
"store_name" "Online Store", | |
"item_name_1" "Awesome Product - MP3", |
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 clj-lmdb.core | |
(:refer-clojure :exclude [get]) ; suppress the shadowing warning | |
(:require [clojure.core :as core]) | |
(:import [org.fusesource.lmdbjni Database Env] | |
[org.fusesource.lmdbjni Constants])) | |
(declare ^:dynamic *txn*) | |
(declare ^:dynamic *db*) | |
(defprotocol LMDB |
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
(def open-for-discussion? (atom true)) | |
(def discussion-count (agent 0)) | |
(def discussion-board (ref [])) | |
(def discussion-board-count 3) | |
(defn open-discussion [duration] | |
(do (Thread/sleep duration) (swap! open-for-discussion? not))) | |
(defn add-discussion [] | |
(future |
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 const Main = { | |
render({props, children, context, path}){ | |
return( | |
<div id="app_container"> | |
<HeaderContainer /> | |
<div id="app_container_yield"> | |
{children} | |
</div> | |
</div> |