This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ 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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 "/" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun uncountable? (word) | |
(member word *uncountables* :test #'string-equal)) | |
(defun irregular? (word) | |
(or (-> word *irregulars*) | |
(rassoc word *irregulars* :test #'string-equal))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(in-package :vana-inflector) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun pluralize (count word &optional plural) | |
(if (not (= count 1)) | |
(or plural | |
(plural-of word)) | |
word)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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)))))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun tag-name (name content) | |
(format nil "<~A>~A</~A>" name content name)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun tag-name (name attributes content) | |
(format nil "<~A ~A>~A</~A>" name (apply #'attrs attributes) content name)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> (tag-name "div" '(id "header" class "navigation") "Hello Lisp!") | |
"<div id=\"header\" class=\"navigation\">Hello Lisp!</div>" |