View project.clj
(defproject just-test "0.0.1-SNAPSHOT"
:description "FIXME: write description"
:url "http://example.com/FIXME"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.8.0"]
[io.pedestal/pedestal.service "0.4.2-SNAPSHOT"]
;; Remove this line and uncomment one of the next lines to
;; use Immutant or Tomcat instead of Jetty:
View service.clj
(ns hello-datomic-041.service
(:require [io.pedestal.http :as http]
[io.pedestal.http.body-params :as body-params]
[io.pedestal.http.route.definition :refer [defroutes]]
[ring.util.response :as ring-resp]
[datomic.api :as d]))
(def uri "datomic:dev://localhost:4334/5745c8fc-6d57-4184-972a-eef798243572")
(def schema-tx
View core.clj
(ns simple-ring.core
(:require [datomic.api :as d]))
(def uri "datomic:dev://localhost:4334/5745c8fc-6d57-4184-972a-eef798243572")
(def schema-tx
[{:db/id #db/id[:db.part/db]
:db/ident :hello/color
:db/valueType :db.type/string
:db/cardinality :db.cardinality/one
View project.clj
(defproject io.pedestal/pedestal.immutant "0.4.2-SNAPSHOT"
:description "Embedded Immutant adapter for Pedestal HTTP Service"
:url "https://github.com/pedestal/pedestal"
:scm "https://github.com/pedestal/pedestal"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.8.0"]
[potemkin "0.4.3"]
#_[org.immutant/core "2.1.4"]
View project.clj
(defproject io.pedestal/pedestal.immutant "0.4.2-SNAPSHOT"
:description "Embedded Immutant adapter for Pedestal HTTP Service"
:url "https://github.com/pedestal/pedestal"
:scm "https://github.com/pedestal/pedestal"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.8.0"]
[potemkin "0.4.2"]
[org.immutant/web "2.1.4" :exclusions [org.jboss.logging/jboss-logging]]]
:min-lein-version "2.0.0"
View error
Exception in thread "main" java.lang.Exception: No namespace: immutant.web.internal.undertow, compiling:(immutant/web/undertow.clj:1:1)
at clojure.lang.Compiler.load(Compiler.java:7391)
at clojure.lang.RT.loadResourceScript(RT.java:372)
at clojure.lang.RT.loadResourceScript(RT.java:363)
at clojure.lang.RT.load(RT.java:453)
at clojure.lang.RT.load(RT.java:419)
at clojure.core$load$fn__5677.invoke(core.clj:5893)
at clojure.core$load.invokeStatic(core.clj:5892)
at clojure.core$load.doInvoke(core.clj:5876)
at clojure.lang.RestFn.invoke(RestFn.java:408)
View core.clj
(ns signups-manager.core
(:require [clojure.edn :as edn]
[clojure.data.json :as json]
[clj-http.client :as http]
[google-apps-clj.credentials :as creds]
[google-apps-clj.google-sheets :as sh]))
(defn read-creds
[]
(edn/read-string (slurp "config/google-creds.edn")))
View gist:27b0c90caaefb61c3dd0
private JAXPExtensionsProvider getProviderInstance() throws ClassNotFoundException, IllegalArgumentException, InstantiationException, IllegalAccessException, InvocationTargetException {
Class<?> clazz = Class.forName("com.sun.org.apache.xpath.internal.jaxp.JAXPExtensionsProvider");
Constructor[] constructors = clazz.getDeclaredConstructors();
for (int i = 0; i < constructors.length; i++) {
Class[] parameterTypes = constructors[i].getParameterTypes();
if (parameterTypes.length == 2) {
return (JAXPExtensionsProvider) constructors[i].newInstance(functionResolver, false);
} else if (parameterTypes.length == 1) {
return (JAXPExtensionsProvider) constructors[i].newInstance(functionResolver);
}
View HMAC_test.rb
KS = Java::JavaxCryptoSpec::SecretKeySpec
MAC = Java::JavaxCrypto::Mac
ENCODER = Java::SunMisc::BASE64Encoder
seed = "66fbcbf2-74b8-46bf-bf8a-fe925efaaa18-Tue Oct 07 09:04:49 EDT 2014"
secret_key = SKS.new(seed.to_java_bytes, "HmacSHA256")
msg = "[12345]".to_java_bytes
buf = Java::JavaIo::ByteArrayOutputStream.new
buf.write(msg, 0, msg.length)
View sentences.clj
(def sentences "The evening passed quietly, unmarked by anything extraordinary. The acknowledged lovers talked and laughed, the unacknowledged were silent. Darcy was not of a disposition in which happiness overflows in mirth; and Elizabeth, agitated and confused, rather knew that she was happy than felt herself to be so; for, besides the immediate embarrassment, there were other evils before her. She anticipated what would be felt in the family when her situation became known; she was aware that no one liked him but Jane; and even feared that with the others it was a dislike which not all his fortune and consequence might do away.")