Skip to content

Instantly share code, notes, and snippets.

View bracki's full-sized avatar

Jan Brauer bracki

View GitHub Profile
(use 'clojure.contrib.seq-utils)
(def graph {:a [:b], :b [:a :c], :c [:b :d], :d [:c]})
(defn find-path
"Find a path between a start and an end node."
([g start end]
(if (contains? g start)
(find-path g start end [])))
([g start end path]
(use '(clojure.contrib str-utils seq-utils duck-streams server-socket))
(def *connections* (ref []))
(defn- ire-handle-client [in out]
(binding [*in* (reader in)
*out* (writer out)]
(dosync (commute *connections* conj *out*))
(loop [input (read-line)]
(when input
@bracki
bracki / urkle.clj
Created February 24, 2009 16:29
Urkle - An awkward IRCd
(use '(clojure.contrib str-utils seq-utils duck-streams server-socket))
(use '(clojure.contrib stacktrace))
(declare *name*)
(def *users* (ref {}))
(def *channels* (ref {}))
creating /usr/lib/python2.5/site-packages/sqlalchemy
error: could not create '/usr/lib/python2.5/site-packages/sqlalchemy': Permission denied
----------------------------------------
Command /usr/bin/python2.5 -c "import setuptools; __file__='/home/jb/code/build/sqlalchemy/setup.py'; execfile('/home/jb/code/build/sqlalchemy/setup.py')" install --single-version-externally-managed --record /tmp/pip-2Ae0kE-record/install-record.txt --install-headers /home/jb/code/lib/include failed with error code 1
Exception information:
Traceback (most recent call last):
File "/usr/lib/python2.5/site-packages/pip-0.4-py2.5.egg/pip.py", line 274, in main
self.run(options, args)
@bracki
bracki / testcase.html
Created September 20, 2010 10:17
Watir WebDriver :class selector bug
>> require "watir-webdriver"
=> true
>> browser = Watir::Browser.new :firefox=> #<Watir::Browser:0x7fc6350c1f90 url="about:blank" title="">
>> browser.goto "file:///tmp/testcase.html"
=> "file:///tmp/testcase.html"
>> browser.divs
=> #<Watir::DivCollection:0x7fc6351366b0 @parent=#<Watir::Browser:0x7fc6350c1f90 url="file:///tmp/testcase.html" title="">, selector{:tag_name=>"div"}
>> browser.divs.length
=> 6
>> browser.divs(:class, "a")
@announce @announce-all
Feature: Configure the dashboard
As a Jimdo employee
I want to configure my dashboard
so that I have all data relevant to me visible in one place
Scenario: Configure config.json
Given a "config.json" file with:
"""
[{"title":"Example", "url":"http://example.com"},
@bracki
bracki / gist:843736
Created February 25, 2011 12:50 — forked from lentil/gist:810399
#!/usr/bin/env python
from __future__ import with_statement
import os
import re
import shutil
import subprocess
import sys
import tempfile
import shlex
@bracki
bracki / lighty.conf
Created April 11, 2011 11:39
borkenness
var.projectdir = env.HOME + "/projects/transifex/transifex"
var.basedir = env.HOME + "/projects/transifex/lighttpd"
server.modules = (
"mod_access",
"mod_alias",
"mod_accesslog",
"mod_extforward",
"mod_rewrite",
"mod_fastcgi",
@bracki
bracki / log
Created December 21, 2011 22:55
ElasticSearch via Thrift and Python
t
twitter][tweet][123], source[€]}]
org.elasticsearch.ElasticSearchParseException: Failed to derive xcontent from (offset=0, length=1): [-128]
at org.elasticsearch.common.xcontent.XContentFactory.xContent(XContentFactory.java:147)
at org.elasticsearch.common.xcontent.XContentHelper.createParser(XContentHelper.java:49)
at org.elasticsearch.index.mapper.DocumentMapper.parse(DocumentMapper.java:428)
at org.elasticsearch.index.mapper.DocumentMapper.parse(DocumentMapper.java:414)
at org.elasticsearch.index.shard.service.InternalIndexShard.prepareIndex(InternalIndexShard.java:302)
# [Mon Jan 16 11:23:14 2012] Protocol: http, Server: 192.168.5.10:9200
curl -XPUT 'http://127.0.0.1:9200/users/?pretty=1' -d '
{
"mappings" : {
"info" : {
"_all" : {
"type" : "string",
"analyzer" : "uax_url_email"
},
"properties" : {