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 'org.httpkit.client.Decoder) | |
(import 'java.nio.ByteBuffer) | |
(.decode (Decoder. nil nil) (ByteBuffer/wrap (.getBytes "HTTP/1.1 200 \r\n" "UTF-8"))) | |
;;=> ProtocolException not http protocol? HTTP/1.1 200 org.httpkit.client.Decoder.parseInitialLine (Decoder.java:77) | |
(pst) | |
;;; ProtocolException not http protocol? HTTP/1.1 200 | |
;;; org.httpkit.client.Decoder.parseInitialLine (Decoder.java:77) | |
;;; org.httpkit.client.Decoder.decode (Decoder.java:88) |
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
setup_lager_logging() -> | |
application:load(lager), | |
ConsoleFormat = [time, " ", pid, {pid, [" "], ""}, | |
{module, [module, ":", line, " "], ""}, | |
message, "\n" | |
], | |
FileFormat = [date, " "] ++ ConsoleFormat, | |
LogDir = os:getenv("LOGDIR"), |
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 blockdude.codec | |
(:require [clojure.string :as str] | |
[gloss.core :as gloss-core :refer :all | |
:exclude [byte-count]] | |
[blockdude.hash :as hash] | |
[blockdude.util :refer :all] | |
[gloss.core.codecs :refer [identity-codec]] | |
[gloss.io :refer :all | |
:exclude [contiguous decode encode]]) | |
(:import [java.lang Character] |
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
<!doctype html> | |
<html> | |
<head> | |
<style> | |
@-webkit-keyframes relocate { | |
0% { top:16px; } | |
50% { top: 64px; } | |
100% { top: 16px; } | |
} | |
video{ |
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
# coding=UTF-8 | |
import nltk | |
from nltk.corpus import brown | |
# This is a fast and simple noun phrase extractor (based on NLTK) | |
# Feel free to use it, just keep a link back to this post | |
# http://thetokenizer.com/2013/05/09/efficient-way-to-extract-the-main-topics-of-a-sentence/ | |
# Create by Shlomi Babluki | |
# May, 2013 |
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 create-draw.opencv | |
(:import | |
org.opencv.core.Core | |
org.opencv.core.Mat | |
org.opencv.core.MatOfRect | |
org.opencv.core.Point | |
org.opencv.core.Rect | |
org.opencv.core.Scalar | |
org.opencv.highgui.Highgui | |
org.opencv.objdetect.CascadeClassifier)) |
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
; will open source in the near future. feedback/questions welcome. | |
(ns com.netflix.astyanax | |
"Clojure bindings for Cassandra via Astyanax | |
# Serializers | |
Serializer, when used in schemas (see below) are typically specified with a keyword. | |
The following are available, corresponding to the Astyanax serializers of the same | |
name: | |
:ascii, :big-integer, :boolean, :bytes, :char, :date, :double, :float, :integer |
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 clojure.core.typed.test.kw-args | |
(:require [clojure.core.typed :refer [ann check-ns ann-form cf]] | |
[clojure.tools.analyzer :refer [ast]] | |
[clojure.tools.analyzer.emit-form :refer [emit-form]])) | |
(ann foo-kw [& {:a Number} -> (U nil Number)]) | |
(defn foo-kw [& {:keys [a]}] | |
(when a | |
(inc a))) |
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
#!/bin/bash | |
for f in $(egrep -o -R "defn?-? [^ ]*" * --include '*.clj' | cut -d \ -f 2 | sort | uniq); do | |
echo $f $(grep -R --include '*.clj' -- "$f" * | wc -l); | |
done | grep " 1$" |
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 net.cgrand.decay | |
"Exponentially decaying lists. See http://awelonblue.wordpress.com/2013/01/24/exponential-decay-of-history-improved/ | |
for background and http://clj-me.cgrand.net/2013/02/12/decaying-lists-log-scale-for-lists/ for documentation") | |
;; PRNG, formulas straight from java.util.Random javadoc | |
(defn- seed ^long [^long n] | |
(bit-and (unchecked-multiply n 0x5DEECE66D) | |
(unchecked-dec (bit-shift-left 1 48)))) | |
(defn- next-seed ^long [^long seed] |