Skip to content

Instantly share code, notes, and snippets.

View sgrove's full-sized avatar
💭
Infinigraph, and beyond!

Sean Grove sgrove

💭
Infinigraph, and beyond!
View GitHub Profile
@sgrove
sgrove / build
Created September 10, 2015 17:48
$ lein cljsbuild once pseudo
Compiling ClojureScript.
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/Users/s/.m2/repository/ch/qos/logback/logback-classic/1.1.2/logback-classic-1.1.2.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/Users/s/.m2/repository/org/slf4j/slf4j-log4j12/1.6.2/slf4j-log4j12-1.6.2.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
10:34:17.824 [main] DEBUG org.jboss.logging - Logging Provider: org.jboss.logging.Slf4jLoggerProvider
10:34:18.666 [main] DEBUG com.amazonaws.AmazonWebServiceClient - Internal logging succesfully configured to commons logger: true
10:34:18.813 [main] DEBUG com.amazonaws.metrics.AwsSdkMetrics - Admin mbean registered under com.amazonaws.management:type=AwsSdkMetrics
10:34:19.620 [main] DEBUG c.a.internal.config.InternalConfig - Configuration override awssdk_config_override.json not found.
# Sauce::Selenium_browsers will have all your browsers
JSON.parse(ENV["SAUCE_ONDEMAND_BROWSERS"]).each do |selenium_browser|
@browser = Selenium::Client::Driver.new(:host => ENV["SAUCE_ONDEMAND_SERVER"],
:port => ENV["SAUCE_ONDEMAND_PORT" ],
:url => ENV["SAUCE_ONDEMAND_URL" ],
:browser => selenium_browser,
:timeout_in_second => 90)
@browser.start_new_browser_session
@browser.open "/"
@sgrove
sgrove / gist:676200
Created November 14, 2010 23:10
:vana-inflector uncountable? irregular?
(defun uncountable? (word)
(member word *uncountables* :test #'string-equal))
(defun irregular? (word)
(or (-> word *irregulars*)
(rassoc word *irregulars* :test #'string-equal)))
@sgrove
sgrove / gist:676209
Created November 14, 2010 23:15
:vana-inflector instruction to work in :vana package
(in-package :vana-inflector)
@sgrove
sgrove / gist:676196
Created November 14, 2010 23:08
:vana-inflector pluralize
(defun pluralize (count word &optional plural)
(if (not (= count 1))
(or plural
(plural-of word))
word))
@sgrove
sgrove / gist:676202
Created November 14, 2010 23:12
:vana-inflector interface for adding rules/exceptions
(defun uncountable (word)
"Notifies the inflector that a word is uncountable"
(push word *uncountables*))
(defun irregular (singular plural)
"Adds a irregular single-plural set to the irregular list"
(push (cons singular plural) *irregulars*))
(defun plural (rule replacement)
"Adds a plural rule, where RULE can be either a string or a regex, and REPLACEMENT can contain capture references defined in RULE"
@sgrove
sgrove / gist:676198
Created November 14, 2010 23:09
:vana-inflector inflector-helper
(defun inflector-helper (word regexes)
(if (null regexes)
word
(multiple-value-bind (string match-found?)
(cl-ppcre:regex-replace (first (first regexes)) word (second (first regexes)))
(if match-found?
string
(inflector-helper word (rest regexes))))))
@sgrove
sgrove / gist:700030
Created November 15, 2010 04:33
tag-name
(defun tag-name (name content)
(format nil "<~A>~A</~A>" name content name))
@sgrove
sgrove / gist:700035
Created November 15, 2010 04:35
updated tag-nam
(defun tag-name (name attributes content)
(format nil "<~A ~A>~A</~A>" name (apply #'attrs attributes) content name))
@sgrove
sgrove / gist:700036
Created November 15, 2010 04:35
example of updated tag-name
> (tag-name "div" '(id "header" class "navigation") "Hello Lisp!")
"<div id=\"header\" class=\"navigation\">Hello Lisp!</div>"