Skip to content

Instantly share code, notes, and snippets.

View billdozr's full-sized avatar

Alen Ribic billdozr

View GitHub Profile
$ sudo port install omake
---> Computing dependencies for omake
---> Fetching ocaml
---> Verifying checksum(s) for ocaml
---> Extracting ocaml
---> Applying patches to ocaml
---> Configuring ocaml
---> Building ocaml
---> Staging ocaml into destroot
---> Installing ocaml @3.11.1_2
DEBUG: Found port in file:///opt/local/var/macports/sources/rsync.macports.org/release/ports/devel/omake
DEBUG: Changing to port directory: /opt/local/var/macports/sources/rsync.macports.org/release/ports/devel/omake
DEBUG: OS Platform: darwin
DEBUG: OS Version: 10.0.0
DEBUG: Mac OS X Version: 10.6
DEBUG: System Arch: i386
DEBUG: setting option os.universal_supported to yes
DEBUG: org.macports.load registered provides 'load', a pre-existing procedure. Target override will not be provided
DEBUG: org.macports.unload registered provides 'unload', a pre-existing procedure. Target override will not be provided
DEBUG: org.macports.distfiles registered provides 'distfiles', a pre-existing procedure. Target override will not be provided
# MacPorts system wide configuration file
# $Id: macports.conf.in 55280 2009-08-08 02:45:30Z [email protected] $
# Set the directory in which to install ports
prefix /opt/local
# Set the user to run MacPorts compiles, etc as when privileges are dropped during an install
macportsuser root
# Where to store MacPorts working data
(autoload 'paredit-mode "paredit"
"Minor mode for pseudo-structurally editing Lisp code." t)
(add-hook 'emacs-lisp-mode-hook (lambda () (paredit-mode +1)))
(add-hook 'lisp-mode-hook (lambda () (paredit-mode +1)))
(add-hook 'lisp-interaction-mode-hook (lambda () (paredit-mode +1)))
(put 'scroll-left 'disabled nil)
(defmacro in? [obj & choices]
(let [insym (gensym)]
`(let [~insym ~obj]
(or ~@(map (fn [c] `(= ~insym ~c))
choices)))))
(defun compile-query (q body)
(case (car q)
(and (compile-and (cdr q) body))
(or (compile-or (cdr q) body))
(not (compile-not (cadr q) body))
(lisp `(if ,(cadr q) ,body))
(t (compile-simple q body))))
(defn update-guest [new]
(let [old (fetch-guest-by-invite-code (:invite_code new))
event (fetch-event-by-guest (:invite_code new))]
(update-event
(update-in event
[:guests]
(fn [o n]
(conj (filter
#(not= (:invite_code %) (:invite_code n)) o) n))
new))))
(defn fizz-buzz
([] (fizz-buzz (range 1 101)))
([lst]
(letfn [(fizz? [n] (zero? (mod n 3)))
(buzz? [n] (zero? (mod n 5)))]
(let [f "Fizz"
b "Buzz"
items (map (fn [n]
(cond (and (fizz? n) (buzz? n)) (str f b)
(fizz? n) f
(defmacro map->entity
[m entype]
`(apply ~(symbol (str "make-" entype))
(interleave (keys ~m) (vals ~m))))
(defmethod db-fetch ::hash-map
[repository key]
(let [result (db-query key (:db repository))]
(map->entity (second result) (first result))))
alen-ribics-macbook:~ alen$ sudo cabal install happstack
Resolving dependencies...
Downloading SMTPClient-1.0.2...
Configuring SMTPClient-1.0.2...
Preprocessing library SMTPClient-1.0.2...
Building SMTPClient-1.0.2...
[1 of 2] Compiling Network.SMTP.ClientSession ( Network/SMTP/ClientSession.hs, dist/build/Network/SMTP/ClientSession.o )
[2 of 2] Compiling Network.SMTP.Client ( Network/SMTP/Client.hs, dist/build/Network/SMTP/Client.o )
ar: creating archive dist/build/libHSSMTPClient-1.0.2.a
Installing library in /Users/alen/.cabal/lib/SMTPClient-1.0.2/ghc-6.10.4