Skip to content

Instantly share code, notes, and snippets.

View bracki's full-sized avatar

Jan Brauer bracki

View GitHub Profile
@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")
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 / 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 {}))
(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
(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]