Skip to content

Instantly share code, notes, and snippets.

(ns irc-parser
(:use clojure.contrib.duck-streams
clojure.contrib.str-utils
clojure.contrib.seq-utils))
(def dates (file-seq (java.io.File. "./clojure")))
(defn parse-irc-log
[logfile]
(line-seq (reader logfile)))
(ns irc-parser.core
(:use clojure.contrib.duck-streams
clojure.contrib.str-utils
clojure.contrib.seq-utils))
(def dates (file-seq (java.io.File. "./clojure")))
(defn parse-irc-log
[logfile]
(line-seq (reader logfile)))
@Licenser
Licenser / core.clj
Created April 1, 2010 02:23 — forked from devn/core.clj
(defn walton [#^String s]
(let [result (walton-doc s)]
(map (fn [text]
(if (>= (count text) 457)
(apply str (take 457 text) "...")
text)) (nth result (rand-int (count result))))
@Licenser
Licenser / core.clj
Created April 1, 2010 16:04 — forked from devn/core.clj
(defn truncate [t coll]
(map (fn [ct]
(if (>= (count ct) t)
(apply str (take t ct) "...")
ct)) coll))
(defn walton*
[#^String s t m?]
(let [result (walton-doc s)]
(defn answer-with [irc-data reply]
(let [{:keys [irc channel nick]} irc-data]
(ircb/send-message irc channel
(str nick ": " reply)))
(defplugin
(:dict
"Takes a word and look's up it's definition via the Wordnik dictionary API."
["dict"]
[{:keys [irc channel nick args] :as data}]
(frame :title "A Button Example"
:layout (FlowLayout.)
:size [220 90]
:show true
[b1 (button "First")
;b1 (button "First" :action ([e] (println "First")))
b2 (button "Second")
lab (label "Press a button")]
(add-action-listener b1 ([e] (println "listener called"))))
## haproxy.cfg
global
user haproxy
group haproxy
daemon
maxconn 16384
pidfile /var/run/haproxy.pid
defaults
use std::io::{Read, Seek, SeekFrom, Write};
use std::slice;
use std::time::Instant;
use std::{fs::OpenOptions, io::Result};
use std::ptr;
use std::mem::forget;
const BUF_SIZE: usize = 1024 * 32;
const FILE_SIZE: usize = 1024 * 1024 * 512;
const QUEUE_DEPTH: usize = 32;