Skip to content

Instantly share code, notes, and snippets.

View cmiles74's full-sized avatar

Christopher Miles cmiles74

View GitHub Profile
@cmiles74
cmiles74 / gist:23299
Created November 9, 2008 15:48
Clojure code for transforming sequences into JSON data
;
; Provides functions for transforming data into JSON objects.
;
; This is Clojure code.
;
(defn data-to-json [list-this]
"Transforms a list into a string of JSON data"
(cond
# Warbler web application assembly configuration file
Warbler::Config.new do |config|
# Temporary directory where the application is staged
# config.staging_dir = "tmp/war"
# Application directories to be included in the webapp.
config.dirs = %w(app config lib log vendor tmp extra lang)
# Additional files/directories to include, above those in config.dirs
# config.includes = FileList["db"]
Next Meeting 3/12/2009, New Venue, New Format
We have a meeting coming up this week (Thursday the 12th). :) We’re also going to be meeting in a different place and we’ll be trying out an entirely new format!
Location
View Larger Map
We’ll be meeting up at the Snowtide office where Chas works. They have access to a good sized meeting room and Chas has been kind enough to volunteer it. It’s located in the Potpourri Plaza in Northampton, across the street from the Stop and Shop.
(progn
(let ((urls ()))
(save-excursion
(goto-char (point-min))
(while
(re-search-forward
"\\<\\(http\\)://[a-zA-Z0-9\-\.\?\&\#]*" nil t)
(let ((start (match-beginning 0))
(end (match-end 0)))
(setq urls (cons
Fatal error: Uncaught exception 'com_exception' with message 'Failed
to create COM object `CAPICOM.Utilities.1': Invalid syntax ' in
D:\apache\intranet\www\ironlogin\installer\index.php:735 Stack trace:
#0 D:\apache\intranet\www\ironlogin\installer\index.php(735):
com->com('CAPICOM.Utiliti...') #1
D:\apache\intranet\www\ironlogin\installer\index.php(161):
Install::GetRandomHash(8192) #2
D:\apache\intranet\www\ironlogin\installer\index.php(55):
Install::CheckEnvironment() #3
D:\apache\intranet\www\ironlogin\installer\index.php(24):
(defn testing [reader-in]
(lazy-seq
(let [text []]
(let [int-in (next-character r)]
(if (not= int-in -1)
(conj text (char int-in))
text)))))
;;
;; Provides functions for managing links.
;;
(ns org.cooleydickinson.crawler.links
(:use [org.cooleydickinson.crawler.tagsoup :only (parse)])
(:import (java.net URL)))
(defn canonicize
"Returns a canonical (not relative) URL for the supplied URL. The
#
# A simple pre-forking server that tests to make sure the MySQL server
# is available.
#
# Based so heavily on the following article by Ryan Tomakyo that it's
# practically a verbatim copy.
#
# http://tomayko.com/writings/unicorn-is-unix
#
# Pasted at http://gist.github.com/213990
def area
# only fetch the list of areas if we have a region
if !params[:region_id].blank?
@region = Region.find(params[:region_id])
@areas = @region.areas
# save the selected region
session[:region_id] = @region.id
(defn piece-line-breaks
"Returns a vector of the indexes of the line breaks in the piece of text"
[buffer piece]
(let [text-buffer (if (= (piece :buffer) :source)
@(buffer :source)
@(buffer :add))]
(reduce (fn [breaks index]
(if (= \newline (. text-buffer get index))