Seperate paragraphs using Python/Sublime2 regular expressions:
\s*?\n\s*?\n\s*?
Fetch all predicate symbol names in second group
(\(defn )(\w.*\?)
(require 'iimage) | |
(autoload 'iimage-mode "iimage" "Support Inline image minor mode." t) | |
(autoload 'turn-on-iimage-mode "iimage" "Turn on Inline image minor mode." t) | |
(add-to-list 'iimage-mode-image-regex-alist '("@startuml\s+\\(.+\\)" . 1)) | |
;; Rendering plantuml | |
(defun plantuml-render-buffer () | |
(interactive) | |
(message "PLANTUML Start rendering") | |
(shell-command (concat "java -jar ~/Downloads/plantuml.jar " |
;; Note: for the best result/experience you should download LightTable at www.lighttable.com | |
;; Open the program, press [^-Space] (Control-Space) and type "Insta" then click/press [Return] to open one and paste this in | |
;; Macro to define/create namespace and bind neatly only the required functions (explicit use of :refer key) | |
(ns clj-no.de | |
^{:doc "Namespace and directives for easy inspection of symbols, hash-maps, namespaces and so on." | |
:author "Rob Jentzema" | |
:version "0.01"} | |
;; These provide us with easy access to some very useful functions |
;; | |
;; NS CHEATSHEET | |
;; | |
;; * :require makes functions available with a namespace prefix. | |
;; | |
;; * :use makes functions available without a namespace prefix | |
;; (i.e., refers functions to the current namespace). | |
;; | |
;; * :import refers Java classes to the current namespace. | |
;; |
;variants of the code from point #2 of: | |
; http://www.tbray.org/ongoing/When/200x/2009/12/01/Clojure-Theses | |
;original | |
(apply merge-with + | |
(pmap count-lines | |
(partition-all *batch-size* | |
(line-seq (reader filename))))) |
Seperate paragraphs using Python/Sublime2 regular expressions:
\s*?\n\s*?\n\s*?
Fetch all predicate symbol names in second group
(\(defn )(\w.*\?)
(defproject gridsystem "0.1.0-SNAPSHOT" | |
:dependencies [[org.clojure/clojure "1.5.1"] | |
[compojure "1.1.5"] | |
[garden "1.0.0-SNAPSHOT"] | |
[ring/ring-jetty-adapter "0.2.5"] | |
[hiccup "1.0.4"]] | |
:plugins [[lein-ring "0.8.5"]] | |
:ring {:handler semantic-gs.handler/app} | |
:profiles | |
{:dev {:dependencies [[ring-mock "0.1.5"]]}}) |
@startuml | |
class Car | |
Driver - Car : drives > | |
Car *- Wheel : have 4 > | |
Car -- Person : < owns | |
@enduml |
(ns long-polling | |
(:require [clojure.data.json :as json])) | |
(def timeout 100) ; sec | |
;[clojure.contrib.http.agent :as h] | |
;(use 'clojure.contrib.http.agent) | |
; fetch, this will wait if no messages are active | |
;(string (http-agent "http://127.0.0.1/activity?id=1")) |
(ns pigeonhole-sort) | |
(defn int-sort [s] | |
(let [listmap (reduce #(update-in | |
(update-in %1 [%2] (fnil inc 0)) | |
[:max] max %2) {:max 0} s)] | |
(mapcat #(repeat (get listmap % 0) %) | |
(range (inc (:max listmap)))))) |