Skip to content

Instantly share code, notes, and snippets.

Christophe Grand cgrand

Block or report user

Report or block cgrand

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View 1a.md

You can use id attributes suffixed by # within your HTML template code in order to generate :#id# selectors that you can later use within Enlive template.

For example, if you say:

<div id="content-main#"></div>

You can later reference it with :#content-main# selector, which will be automatically generated for you.

View gist:7638887
(require '[ccw.util.e4 :as e4])
;; e is anything that can reach an IEclipseContext. Extend protocol e4/HasContext
;; to your type:
;(defprotocol HasContext
; "Protocol for retrieving the associated IEclipseContext for objects
; for which this makes sense."
; (-context [o] "Return the context for o, or nil"))
(def cmd-id "hello-6")
View macros.clj
(ns lein-script-test
(:require [ccw.util.eclipse :as e]))
(defn greet [context]
(e/info-dialog "Hello world"
"This popup provided to you from a user script"))
;; these two def* build the fragment using the provided symbol and the current ns
(defcommand greeter
:command-name "Greetings from CCW"
View payload.json
{"user":
{"actions": {},
"properties":
{"givenName": "mike",
"faimlyName": "amundsen",
"email": "m...@example.org"}}}
View mutabots.clj
(ns mutabots
"Reimplementation of transducers, in terms of processing functions instead
of reducing functions.
tl;dr: reducing-fn based transducers are a special case, influenced by reducers,
of processing-fn based transducers.
In Clojure 1.7.0-alpha2, transducers are expressed in terms of the existing
concept of reducing functions.
To sum it up, a transducer has currently the signature :
View foami.clj
(ns foami.core
"FOreign Asynchronous Mechanism Interop"
(:require [clojure.core.async :as async]))
(defn put!
"Takes a `ch`, a `msg`, a single arg function that when passed `true` enables backpressure
and when passed `false` disables it, and a no-arg function which, when invoked, closes the
upstream source."
[ch msg backpressure! close!]
(let [status (atom :sending]
View maze-generation
(require '[clojure.string :as s])
;; Maze GENERATION
(defn north-of [[row col]] [(dec row) col])
(defn south-of [[row col]] [(inc row) col])
(defn west-of [[row col]] [row (dec col)])
(defn east-of [[row col]] [row (inc col)])
(defn neighbours [rows cols cell]
You can’t perform that action at this time.