Skip to content

Instantly share code, notes, and snippets.

cc -DBUILD="\"1.3\"" -std=c99 -D_GNU_SOURCE -D_POSIX_SOURCE -iquote. -c -o cmd-pipe-pane.o cmd-pipe-pane.c
cmd-pipe-pane.c: In function ‘cmd_pipe_pane_exec’:
cmd-pipe-pane.c:67: warning: implicit declaration of function ‘bufferevent_free’
cmd-pipe-pane.c:122: warning: implicit declaration of function ‘EVBUFFER_LENGTH’
cmd-pipe-pane.c:122: error: dereferencing pointer to incomplete type
cmd-pipe-pane.c:124: warning: implicit declaration of function ‘bufferevent_new’
cmd-pipe-pane.c:125: warning: assignment makes pointer from integer without a cast
cmd-pipe-pane.c:126: warning: implicit declaration of function ‘bufferevent_enable’
make: *** [cmd-pipe-pane.o] Error 1
~/projects/cloby ➔ cat examples/simple.rb
require 'cloby'
class MyClojureObj < Clojure::Object
def initialize
dosync { @foo = 'foo' }
end
attr_accessor :foo
end
(defn quoted-string [ch]
(let [quoteSeparator (is-char ch)
stringBody (stringify (many1 (either (not-char-of #{ch \# \newline}) (not-followed-by (string "#") (string "{")))))
expressionBody (let-bind [_ (string "#{")
expr (stringify (many1 (not-char \})))
_ (string "}")]
(result (read-string expr)))
expansionBody (many (either stringBody expressionBody))
optimize (fn [exp] (if (== 2 (count exp)) (second exp) exp))]
(>>== (between quoteSeparator quoteSeparator expansionBody) #(optimize (apply list 'str %)))))
@devn
devn / model.js
Created January 28, 2011 17:11 — forked from wagenet/model.js
MyApp.MyModel.mixin({
resourcePathFor: function(action, storeKey, item) {
var id, path;
id = storeKey ? MyApp.store.idFor(storeKey) : null;
switch(action) {
case 'fetch':
case 'create':
path = 'items';
watch( 'test/.*\.clj' ) {|md| test_stuff }
watch( 'src/.*\.clj' ) {|md| test_stuff }
def colorize(text, color_code)
"#{color_code}#{text}\e[1;37m"
end
def red(text); colorize(text, "\e[0;31m"); end
def green(text); colorize(text, "\e[0;32m"); end
@devn
devn / gist:835627
Created February 20, 2011 02:39
Factor out condp and keyed functions into updatable structures
;; I have two primary goals:
;; 1.) ...{:foo (fn ...)}... should be defined outside of the
;; function-map in a way that allows you to update :foo's (fn ...)
;; (perhaps a ref, an atom?)
;; 2.) The cases for condp: "fred", "ethel" should live in a structure
;; that can be updated as well. For instance, if I want to add "lucy"
;; (handle-lucy a b c d) to the condp I'd like to be able to do that
;; by using a separate structure to hold all of the cases for the
@devn
devn / gist:837859
Created February 21, 2011 22:52
mailtomutt build failure on homebrew
defn@polyglot Homebrew (master) $ brew install -v mailtomutt
==> Build Environment
CC: /usr/bin/cc => /usr/bin/gcc-4.2
CXX: /usr/bin/c++ => /usr/bin/c++-4.2
LD: /usr/bin/cc => /usr/bin/gcc-4.2
CFLAGS: -O3 -w -pipe
CXXFLAGS: -O3 -w -pipe
MAKEFLAGS: -j4
==> Downloading http://downloads.sourceforge.net/project/mailtomutt/MailtoMutt/v0.4.1/mailtomutt-0.4.1.tar.bz2
File already downloaded and cached to /Users/defn/Library/Caches/Homebrew
@devn
devn / gist:854070
Created March 4, 2011 02:34
clojure regex
(defn extract-sexps
"Extracts s-exp from a string."
[#^String string]
(second
(reduce (fn [[exp exps state cnt] c]
(cond
(= state :escape)
[(.append exp c) exps :string cnt]
(= state :string) (cond
(= c \")
;; Clojure
;; Load files, set mode based on hooks and filename
(require 'clojure-mode)
(autoload 'clojure-mode "clojure-mode" "A major mode for Clojure" t)
(add-to-list 'auto-mode-alist '("\\.clj$" . clojure-mode))
(require 'swank-clojure)
(require 'slime)
@devn
devn / devins-slime-clojure-swank.el
Created April 8, 2011 15:30
This is a dirty config that you'll need to modify to fit your own needs, but in general it has some nice stuff you might want to add to your own config.
;; Clojure
;; Load files, set mode based on hooks and filename
(require 'clojure-mode)
(autoload 'clojure-mode "clojure-mode" "A major mode for Clojure" t)
(add-to-list 'auto-mode-alist '("\\.clj$" . clojure-mode))
(require 'swank-clojure)