Skip to content

Instantly share code, notes, and snippets.

View danlentz's full-sized avatar

Dan Lentz danlentz

View GitHub Profile
I've just put up a large chunk of my Twitter archives up on the
Talis Platform service. Talis Platform is a 'cloud'-based
triplestore hosting service. More at http://n2.talis.com
A triplestore is like a database but for graphs of RDF triples.
The cool thing about RDF and the triplestore is that you
basically have a completely schema-less datastore. You don't have
to figure out "Oh, there's integers going in this field and
strings going in that". You just upload a big pile of RDF and the
triplestore keeps it all there. This is obviously not as efficient
as using a database, so if you want to grow to Google size, it may
@gruber
gruber / Liberal Regex Pattern for All URLs
Last active May 29, 2024 00:03
Liberal, Accurate Regex Pattern for Matching All URLs
The regex patterns in this gist are intended to match any URLs,
including "mailto:foo@example.com", "x-whatever://foo", etc. For a
pattern that attempts only to match web URLs (http, https), see:
https://gist.github.com/gruber/8891611
# Single-line version of pattern:
(?i)\b((?:[a-z][\w-]+:(?:/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))
;; -*- Mode: Lisp; Syntax: Common-Lisp -*-
;;; Package Management
(in-package :cl-user)
(defpackage :hige
(:use :cl
:drakma
:cl-ppcre)
#+ABCL (:shadow :y-or-n-p)
;;;; A simple Google Chart wrapper for Common Lisp
;;;
;;; API reference: http://code.google.com/apis/chart/
;;;
;;; WARNING: Incomplete and buggy -- still has much to be done, e.g.:
;;;
;;; * more thorough testing (that won't be hard...)
;;;
;;; * handle spaces/newlines appropriately
; Fizzbuzz kata (see http://codingdojo.org/cgi-bin/wiki.pl?KataFizzBuzz)
(defpackage :fizzbuzz-test
(:use :cl :lisp-unit :fizzbuzz))
(in-package :fizzbuzz-test)
(define-test fizzbuzz
(let ((seq (fizzbuzz::fizzbuzz-sequence)))
(assert-equal 100 (length seq))
import re
# http://atomboy.isa-geek.com/plone/Members/acoil/programing/double-metaphone
from metaphone import dm as double_metaphone
# get the Redis connection
from jellybean.core import redis
import models
# Words which should not be indexed
@pyropeter
pyropeter / gist:506166
Created August 3, 2010 10:31
Google Search API documentation
# http://www.google.com/uds/GwebSearch?q=foo%20bar&v=1.0
{ responseStatus: 200
, responseData:
{ results:
[ { visibleUrl: 'www.foobar2000.org'
, titleNoFormatting: 'foobar2000'
, cacheUrl: 'http://www.google.com/search?q=cache:obAJTkESjhwJ:www.foobar2000.org'
, title: 'foobar2000'
, content: 'Media player with simple UI and low memory use. Offers plugin support for new features. Includes link to forum focused on application. [Win32]'
#!/usr/bin/env ruby -rubygems
#
# Simple Ruby interface for evaluating Common Lisp code, for use with RSpec.
# Written in August 2010 by Arto Bendiken <http://ar.to/>
#
# This is free and unencumbered software released into the public domain.
require 'open4' # `sudo gem install open4`
require 'bert'
require 'bert/decode'
@nikodemus
nikodemus / irc.txt
Created November 2, 2010 11:19
Notes re. debugging Common Lisp with SBCL and Slime
Context from IRC logs for future reference.
[12:36] <kushal> nikodemus, can you point me to some tutorial on debugging on sbcl ?
[12:37] * andreer (andreer@flode.pvv.ntnu.no) has joined #quicklisp
[12:38] <nikodemus> kushal: no really good ones actually exist at the moment. i'm planning on writing one before the year is out, but... in the meanwhile, i can give some pointers
[12:38] <nikodemus> a couple of questions: is this a general question, or do you have a specific issue you need to debug?
[12:39] <kushal> right now , general, managed to debug the specific issue somehow :)
[12:39] <nikodemus> ok. are you using slime?
[12:39] <kushal> nikodemus, yes and no both
[12:40] <nikodemus> good. :)
@stuartsierra
stuartsierra / resource.clj
Created March 4, 2011 20:32
Automatic Resource Cleanup with PhantomReferences
(ns resource
"Automatic resource cleanup."
(:import (java.lang.ref ReferenceQueue PhantomReference)))
(def ^:private queue (ReferenceQueue.))
(def ^:private cleanup-fns {})
(defn resource
"Returns a reference to x. At some point after the reference is