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
#!/bin/sh | |
# Ubuntu 12.04 | |
# sudo apt-get -y install p7zip-full genisoimage | |
wget http://www.tinycorelinux.net/4.x/x86/release/Core-current.iso | |
wget http://www.tinycorelinux.net/4.x/x86/release/distribution_files/core64.gz | |
wget http://www.tinycorelinux.net/4.x/x86/release/distribution_files/vmlinuz64 | |
# extract files | |
7z x Core-current.iso -ocore-current |
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
admin@mailserver1 | |
niceandsimple@example.com | |
very.common@example.com | |
a.little.lengthy.but.fine@dept.example.com | |
disposable.style.email.with+symbol@example.com | |
postbox@com | |
user@[192.168.2.1] | |
user@[IPv6:2001:db8:1ff::a0b:dbd0] |
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 test1 | |
(:require [instaparse.core :as insta] | |
[net.cgrand.enlive-html :as enlive] | |
[clojure.walk :as walk])) | |
(defn render [nodes] | |
(walk/postwalk #(if (and (map? %) (:tag %)) | |
(with-meta (hash-map (:tag %) (:content %)) (:attrs %)) | |
%) nodes)) |
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 stuff | |
(:require [instaparse.core :as insta])) | |
(def hdl-parse | |
(insta/parser | |
"CHIP = <'CHIP'> <SPACE+> NAME <SPACE*> <'{'> <SPACE*> INSPEC <SPACE*> OUTSPEC <SPACE*> PARTS <SPACE*> <'}'> | |
INSPEC = <'IN'> <SPACE+> (SPECITEM <SPACE*> <','?> <SPACE*>)* <';'> | |
OUTSPEC = <'OUT'> <SPACE+> (SPECITEM <SPACE*> <','?> <SPACE*>)* <';'> | |
PARTS = <'PARTS:'> <SPACE*> (PART <SPACE*>)* | |
PART = NAME <'('> (<SPACE*> PARTIO <','>?)+ <');'> |
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 markov-chain | |
(:require [clojure.string :as string])) | |
(defn simple-weighted-rand-nth [m] | |
(let [ks (keys m) | |
vs (map m ks) ; Ensure map value ordering | |
ranges (reductions + vs) | |
x (rand-int (last ranges)) | |
i (count (take-while #(<= % x) ranges)) | |
k (nth ks i)] |
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 data (str "37900490610897696126265185408732594047834333441947" | |
"01850393807417064181700348379116686008018966949867" | |
"75587222482716536850061657037580780205386629145841" | |
"06964490601037178417735301109842904952970798120105" | |
"47016802197685547844962006690576894353336688823830" | |
"22913337214734911490555218134123051689058329294117" | |
"83011983450277211542535458190375258738804563705619" | |
"55277740874464155295278944953199015261800156422805" | |
"72771774460964310684699893055144451845092626359982" | |
"79063901081322647763278370447051079759349248247518")) |
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 stuff | |
(:require [instaparse.core :as insta] | |
[clojure.walk :as walk])) | |
(defn hiccup->sexp [sym-ns data] | |
(let [sym-ns-fn #(symbol sym-ns %)] | |
(walk/postwalk (fn [x] (if (and (vector? x) (keyword? (first x))) | |
(conj (rest x) (-> x first name sym-ns-fn)) | |
x)) | |
data))) |
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
(require '[net.cgrand.enlive-html :as e]) | |
(defn gen-transform [target] | |
[[(cond | |
(string? target) e/text-node | |
(map? target) (:tag target) | |
:else e/any-node)] | |
#(when (not= target %) %)]) | |
(defn remove-node [coll & nodes] |
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 gitter.TreeIterator | |
(:import [org.eclipse.jgit.lib Repository FileMode] | |
[org.eclipse.jgit.treewalk WorkingTreeIterator WorkingTreeIterator$Entry WorkingTreeOptions] | |
[java.io ByteArrayInputStream]) | |
(:gen-class :extends org.eclipse.jgit.treewalk.WorkingTreeIterator | |
:init init2 | |
:post-init postinit | |
:state state | |
:constructors {[org.eclipse.jgit.lib.Repository Object] [org.eclipse.jgit.treewalk.WorkingTreeOptions] | |
[org.eclipse.jgit.lib.Repository Object org.eclipse.jgit.treewalk.WorkingTreeIterator] [org.eclipse.jgit.treewalk.WorkingTreeIterator]})) |
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 ohm | |
(:require [clojure.string :as string] | |
[clojure.java.io :refer [as-file]]) | |
(:import [java.io File])) | |
(defrecord Leaf [nss declares fns]) | |
(defn parse-value [value] | |
value) |
NewerOlder