Skip to content

Instantly share code, notes, and snippets.

View mpenet's full-sized avatar
🪲
breeding bugs

Max Penet mpenet

🪲
breeding bugs
View GitHub Profile
#!upstart
respawn
start on runlevel [2345]
stop on runlevel [!2345]
script
exec/usr/bin/redis-server > /dev/null 2>&1
end script
@mpenet
mpenet / gist:1672548
Created January 24, 2012 20:55
cute java stacktrace
lamina.core.pipeline -
lamina.core.pipelinejava.lang.IllegalArgumentException: No
implementation of method: :take-contiguous-bytes- of protocol:
#'gloss.data.bytes.core/BufferSequence found for class:
clojure.lang.Cons at
clojure.core$_cache_protocol_fn.invoke(core_deftype.clj:471) at
gloss.data.bytes.core$eval4279$fn__4365$G__4258__4372.invoke(core.clj:38) at
gloss.data.bytes.core$take_contiguous_bytes.invoke(core.clj:67) at
clojure.lang.Var.invoke(Var.java:369) at
gloss.data.string.codecs$take_string_from_buf_seq.invoke(codecs.clj:43) at
mpenet@thinkbox:~$ sudo easy_install clojure-py
[sudo] password for mpenet:
Searching for clojure-py
Reading http://pypi.python.org/simple/clojure-py/
Reading https://github.com/halgari/clojure-py
Best match: clojure-py 0.1.0
Downloading http://pypi.python.org/packages/source/c/clojure_py/clojure_py-0.1.0.tar.gz#md5=794da1e8031e2d4f3fbc6484ed51c172
Processing clojure_py-0.1.0.tar.gz
Running clojure_py-0.1.0/setup.py -q bdist_egg --dist-dir /tmp/easy_install-yOz8Ho/clojure_py-0.1.0/egg-dist-tmp-P06kvb
Traceback (most recent call last):
@mpenet
mpenet / gist:2053633
Created March 16, 2012 23:42
useful bit from cgrand
(defn scaffold [iface]
(doseq [[iface methods] (->> iface .getMethods
(map #(vector (.getName (.getDeclaringClass %))
(symbol (.getName %))
(count (.getParameterTypes %))))
(group-by first))]
(println (str " " iface))
(doseq [[_ name argcount] methods]
(println
(str " "
@mpenet
mpenet / gist:2220275
Created March 27, 2012 21:11
cute regex
/((?:^|$|[^&\/a-z0-9_ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþş\303\277Ѐ-ӿԀ-ԧⷠ-ⷿꙀ-ꚟᄀ-ᇿ㄰-ㆅꥠ-꥿가-힯ힰ-퟿ᄀ-ᅵァ-ヺー-ヾヲ-゚ー0-9A-Za-zぁ-ゖ゙-ゞ㐀-䶿一-鿿꜀-뜿띀-렟-﨟々〻]))(#|#)([a-z0-9_ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþş\303\277Ѐ-ӿԀ-ԧⷠ-ⷿꙀ-ꚟᄀ-ᇿ㄰-ㆅꥠ-꥿가-힯ힰ-퟿ᄀ-ᅵァ-ヺー-ヾヲ-゚ー0-9A-Za-zぁ-ゖ゙-ゞ㐀-䶿一-鿿꜀-뜿띀-렟-﨟々〻]*[a-z_ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþş\303\277Ѐ-ӿԀ-ԧⷠ-ⷿꙀ-ꚟᄀ-ᇿ㄰-ㆅꥠ-꥿가-힯ힰ-퟿ᄀ-ᅵァ-ヺー-ヾヲ-゚ー0-9A-Za-zぁ-ゖ゙-ゞ㐀-䶿一-鿿꜀-뜿띀-렟-﨟々〻][a-z0-9_ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþş\303\277Ѐ-ӿԀ-ԧⷠ-ⷿꙀ-ꚟᄀ-ᇿ㄰-ㆅꥠ-꥿가-힯ힰ-퟿ᄀ-ᅵァ-ヺー-ヾヲ-゚ー0-9A-Za-zぁ-ゖ゙-ゞ㐀-䶿一-鿿꜀-뜿띀-렟-﨟々〻]*)/gi
@mpenet
mpenet / gist:2479743
Created April 24, 2012 13:39
lamina maybe pipeline (exits if any stage returns nil)
(defmacro maybe-pipeline [& opts+stages]
(let [[options stages] (split-options opts+stages (meta &form))]
`(pipeline ~@(concat options
(interpose #(if (nil? %)
(complete nil)
%)
stages)))))
@mpenet
mpenet / org.css
Created April 24, 2012 21:05
org-mode html export blu'ish theme
body {
margin: 1em;
border-right: 5px solid #bbb;
border-bottom: 5px solid #bbb;
padding: 0;
background: #ddd none repeat scroll 0 0;
border: 1px solid #000;
margin: 0;
padding: 2em;
color: #333;
mpenet@thinkbox:~$ cabal install happy
Resolving dependencies...
Downloading happy-1.18.9...
[1 of 1] Compiling Main ( /tmp/happy-1.18.94212/happy-1.18.9/Setup.lhs, /tmp/happy-1.18.94212/happy-1.18.9/dist/setup/Main.o )
/tmp/happy-1.18.94212/happy-1.18.9/Setup.lhs:6:52:
Warning: In the use of `buildVerbose'
(imported from Distribution.Simple.Setup):
Deprecated: "Use buildVerbosity instead"
;; ~/.lein/user.clj
(if (>= (.compareTo (clojure-version) "1.3.0") 0)
(do (use 'clojure.repl)
(use 'clojure.java.javadoc)))
@mpenet
mpenet / gist:3061412
Created July 6, 2012 17:16
threads and me
2012-07-06 19:15:32
Full thread dump Java HotSpot(TM) 64-Bit Server VM (20.1-b02 mixed mode):
"Attach Listener" daemon prio=10 tid=0x00000000412e3800 nid=0x40f7 waiting on condition [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
Locked ownable synchronizers:
- None