๐
This file contains hidden or 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/clisp | |
(defconstant ticks (list "โ" "โ" "โ" "โ" "โ " "โ" "โ" "โ")) | |
(defun spark (data-list) | |
(let ((max-value (apply #'max data-list)) | |
(ticks-length (length ticks))) | |
(let ((ticks-unit (/ max-value (- ticks-length 1)))) | |
(map 'list (lambda (x) (elt ticks (ceiling (/ x ticks-unit)))) data-list)))) |
This file contains hidden or 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 gen-class-test.imgscale | |
(:use [clojure.java.io]) | |
(:import [javax.imageio ImageIO]) | |
(:import [com.mortennobel.imagescaling ResampleOp ResampleFilters])) | |
(defn read-img [path] | |
(ImageIO/read (file path))) | |
(defn write-img [img path] | |
(ImageIO/write img "jpg" (file path))) |
This file contains hidden or 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 slackerbench.core | |
(:use [slacker.client]) | |
(:import [java.util.concurrent Executors TimeUnit]) | |
(:gen-class)) | |
(defn -main [& args] | |
(def host (first args)) | |
(def total-connections (Integer/valueOf (nth args 2))) | |
(def scp (slackerc-pool host 2104 |
This file contains hidden or 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 cljs-demo.socket | |
(:require [cljs.nodejs :as node])) | |
(def net (node/require "net")) | |
(declare client) | |
(defn send-data [] | |
(let [version 3 | |
packet-type 0 |
This file contains hidden or 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
.roar-body | |
{ | |
position: absolute; | |
font: 12px/14px "Lucida Grande", Arial, Helvetica, Verdana, sans-serif; | |
color: #fff; | |
text-align: left; | |
z-index: 999; | |
} | |
.roar |
This file contains hidden or 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 fly.core | |
(:use [cemerick.pomegranate :only [add-dependencies]])) | |
(def default-repos | |
(merge cemerick.pomegranate.aether/maven-central | |
{"clojars" "http://clojars.org/repo"})) | |
(defn grab [deps & | |
{:keys [repositories] | |
:or [repositories {}]}] |
This file contains hidden or 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
<Map background-color="#232323" minimum-version="0.7.2" srs="+proj=latlong +datum=WGS84"> | |
<Style name="style-by-timestamp"> | |
<Rule> | |
<Filter>[timestamp] = '2012'</Filter> | |
<LineSymbolizer stroke="#95a7ed" stroke-width="1" /></Rule> | |
<Rule> | |
<ElseFilter /> | |
<LineSymbolizer stroke="#9090A0" stroke-width="1" /></Rule> | |
</Style> |
This file contains hidden or 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
import clj | |
import time | |
s = "[1 2 3 true false nil {:a 21.3 :b 43.2} \"Hello\"]" | |
t1 = time.time() | |
for i in range(10000): | |
clj.loads(s) | |
print time.time()-t1 |
This file contains hidden or 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 dosync+ [listeners & body] | |
`(let [on-start# (get ~listeners :on-start identity) | |
on-retry# (get ~listeners :on-retry identity) | |
on-committed# (get ~listeners :on-committed identity) | |
retires# (atom 0) | |
ctx# (atom {})] | |
(dosync | |
(if (zero? @retires#) | |
(swap! ctx# on-start#) | |
(swap! ctx# on-retry#)) |
This file contains hidden or 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 link-test.tcp | |
(:refer-clojure :exclude [float byte double]) | |
(:use [link core tcp codec])) | |
(def echo-handler | |
(create-handler | |
(on-message [ctx e] | |
(let [channel (.getChannel ctx)] | |
(.write channel | |
(.getMessage e)))))) |