Skip to content

Instantly share code, notes, and snippets.

<plugin>
<groupId>com.theoryinpractice.clojure</groupId>
<artifactId>clojure-maven-plugin</artifactId>
<version>1.0-SNAPSHOT</version>
<executions>
<execution>
<id>clojure-compile</id>
<goals>
<goal>compile</goal>
</goals>
(ns com.theoryinpractise.clojure.runnable
(:gen-class
:implements [java.lang.Runnable]))
(defn -run [this]
(println "Hello World... from clojure!"))
package com.theoryinpractise.clojure;
import org.osgi.framework.ServiceReference;
import org.osgi.service.component.ComponentContext;
import java.util.Properties;
/**
* @scr.component
*/
diff --git a/src/jvm/clojure/lang/RT.java b/src/jvm/clojure/lang/RT.java
index 502f00d..2e6e01b 100644
--- a/src/jvm/clojure/lang/RT.java
+++ b/src/jvm/clojure/lang/RT.java
@@ -348,8 +348,7 @@ static public long lastModified(URL url,String libfile) throws Exception{
}
else
{
- File f = new File(url.toURI());
- return f.lastModified();
<plugin>
<groupId>org.clojure</groupId>
<artifactId>clojure-maven-plugin</artifactId>
<version>1.0-SNAPSHOT</version>
<configuration>
<namespaces>
<namespace>clj-web-crawler</namespace>
<namespace>smx-api</namespace>
</namespaces>
<testScript>src/test/java/test.clj</testScript>
(ns tip-smtp)
(defn morph-javamail-session
"Lookup the javamail session provided by mor.ph"
[]
(.lookup (javax.naming.InitialContext.) "java:/comp/env/mail/Session"))
(defn sendmail [& optlist]
"Send an email"
(let [opts (apply hash-map optlist)]
; Convert history of the internet printable wiki into PDF
; source from http://www.nethistory.co.nz/index.php/Main_Page
(use 'clojure.contrib.str-utils)
(import '(java.io ByteArrayInputStream FileOutputStream File)
'(javax.xml.parsers DocumentBuilderFactory))
(load-file "clj_web_crawler.clj")
(System/setProperty "xr.text.aa-fontsize-threshhold" "10")
public class EvalCommand extends AbstractCommand {
@Override
public void execute(CommandCall commandCall, Evaluator evaluator, ResultRecorder resultRecorder) {
Check.isFalse(commandCall.hasChildCommands(), "Nesting commands inside an 'eval' is not supported");
Element element = commandCall.getElement();
String evalString = element.getText();
<p>
<span smx:eval="">Given a customer with a user</span>,
that user should be able to <span smx:eval="">edit their own Details</span>.
</p>
public void givenACustomerWithAUser() throws ScriptException, IOException, InterruptedException {
// do what ever is needed to create the customer, and a user, store as an instance var
}
public void editTheirOwnDetails() throws IOException {
// Do something to check the user can edit their details, throw an exception/assertion if false
}