This file contains hidden or 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
-- Copyright (c) 2011, Jeremy Wall | |
-- | A moving readable/writable window on an IO Handle. | |
module FileWindow ( | |
FileWindow | |
, WindowReadResult(..) | |
, newFileWindow | |
, emptyWindow | |
-- Accessors | |
, getHandle |
This file contains hidden or 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
for lib in $(cat file.cabal | grep build-depends | sed 's/^ *//' | awk '{print $2}'); | |
do | |
cabal --reinstall --enable-library-profiling $lib; | |
done |
This file contains hidden or 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
#define _XOPEN_SOURCE 500 | |
#include <unistd.h> | |
#include "output_buffer.h" | |
void stdout_output_buffer ( int out_fd, uint8_t* buffer, size_t buffer_size ) | |
{ | |
while ( buffer_size ) | |
{ | |
const ssize_t r = write( out_fd, (void*) buffer, buffer_size ); |
This file contains hidden or 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 com.freiheit.clojure.appengine.appengine-local | |
(:use | |
[compojure.http routes servlet helpers] | |
clojure.contrib.test-is | |
compojure.server.jetty | |
[clojure.contrib def str-utils duck-streams]) | |
(:require | |
[clojure.contrib.logging :as log]) | |
(:import | |
[com.google.appengine.api.labs.taskqueue.dev LocalTaskQueue] |
This file contains hidden or 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
;;; all code in this function lifted from the clojure-mode function | |
;;; from clojure-mode.el | |
(defun clojure-font-lock-setup () | |
(interactive) | |
(set (make-local-variable 'lisp-indent-function) | |
'clojure-indent-function) | |
(set (make-local-variable 'lisp-doc-string-elt-property) | |
'clojure-doc-string-elt) | |
(set (make-local-variable 'font-lock-multiline) t) |
This file contains hidden or 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
(defmacro defdstest | |
"Set up an appengine datastore test using local in memory datastore." | |
[nm & body] | |
`(clojure.test/deftest ~nm | |
(let [helper-conf# (LocalDatastoreServiceTestConfig.) | |
helper# (LocalServiceTestHelper. helper-conf#)] | |
(.setUp helper#) | |
(try | |
~@body | |
(finally (.tearDown helper#))))) |
This file contains hidden or 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
; minihttpd, tiny barebones clojure web server | |
; http://alan.xen.prgmr.com/ | |
(ns alandipert.minihttpd | |
(:use [clojure.contrib.duck-streams :only (reader writer read-lines spit to-byte-array)] | |
[clojure.contrib.str-utils :only (re-split str-join re-gsub)]) | |
(:import (java.net ServerSocket URLDecoder) | |
(java.io File))) | |
(def codes {200 "HTTP/1.0 200 OK" |
This file contains hidden or 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
(defn distinctp | |
"Returns a lazy sequence of the elements of coll with duplicates removed" | |
[pred coll] | |
(let [step (fn step [xs seen] | |
(lazy-seq | |
((fn [[f :as xs] seen] | |
(when-let [s (seq xs)] | |
(if (contains? seen (pred f)) | |
(recur (rest s) seen) | |
(cons f (step (rest s) (conj seen (pred f))))))) |
This file contains hidden or 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
import XMonad | |
import XMonad.Hooks.DynamicLog | |
import XMonad.Hooks.ManageDocks | |
import XMonad.Layout | |
import XMonad.Layout.Column | |
import XMonad.Layout.LayoutBuilder | |
import XMonad.Config.Desktop | |
import XMonad.Util.EZConfig | |
import XMonad.Util.Run(spawnPipe) |
This file contains hidden or 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
#!/usr/bin/perl -w | |
use Mac::Growl qw{:all}; | |
use Getopt::Long; | |
=pod | |
Put this script in a your $PATH and set it to be executable. | |
=cut | |