Skip to content

Instantly share code, notes, and snippets.

View lispnik's full-sized avatar
💭
Buggered if I know

lispnik

💭
Buggered if I know
View GitHub Profile
#
# Makefile - blinkasm.elf
#
# Author: Rick Kimball
# email: rick@kimballsoftware.com
# Version: 1.03 Initial version 10/21/2011
APP=blinkasm
MCU=msp430g2553
standalone.xml:
...
<jms-destinations>
<jms-queue name="queue/example">
<entry name="queue/example"/>
<!-- <entry name="java:jboss/exported/jms/queue/test"/> -->
</jms-queue>
</jms-destinations>
</hornetq-server>
standalone.xml:
...
<jms-destinations>
<jms-queue name="queue/test">
<entry name="java:/queue/test"/>
<durable>true</durable>
</jms-queue>
</jms-destinations>
</hornetq-server>
(defproject mytest "1.0.0-SNAPSHOT"
:dependencies [[org.clojure/clojure "1.4.0"]
;; [org.clojure/google-closure-library "0.0-1376"]
;; [org.clojure/google-closure-library-third-party "0.0-1376"]
]
:plugins [[lein-cljsbuild "0.2.1"]]
:cljsbuild {:builds [{:source-path "src-cljs"
:compiler {:output-to "extension/mytest.js"
:optimizations :advanced}}]})
(defn- boot-spring
"Initialize a Jetty server for Spring and also Spring Security"
([server handler context-config-location]
(let [filter (doto (org.mortbay.jetty.servlet.FilterHolder. org.springframework.web.filter.DelegatingFilterProxy)
(.setName "springSecurityFilterChain"))
servlet (doto (org.mortbay.jetty.servlet.ServletHolder. (ring.util.servlet/servlet handler))
(.setName "default"))
context (doto (org.mortbay.jetty.servlet.Context. server "/"
(bit-or org.mortbay.jetty.servlet.Context/SESSIONS
org.mortbay.jetty.servlet.Context/SECURITY))
<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns:beans="http://www.springframework.org/schema/beans"
xmlns="http://www.springframework.org/schema/security"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security.xsd">
<authentication-manager>
<authentication-provider>
<user-service>
<user name="user" password="1234" authorities="ROLE_USER"/>
(defn boot []
(jetty/run-jetty #'app
{:port 9090
:join? false
:configurator (fn [server] (boot-spring server #'app "classpath:security.xml"))
:default-handler? false}))
@lispnik
lispnik / gist:1221146
Created September 16, 2011 03:42
Spring/Spring Security bootstrapper for Jetty and Ring
(defn- boot-spring
"Initialize a Jetty server for Spring and also Spring Security"
([server handler context-config-location]
(let [filter (doto (org.mortbay.jetty.servlet.FilterHolder. org.springframework.web.filter.DelegatingFilterProxy)
(.setName "springSecurityFilterChain"))
servlet (doto (org.mortbay.jetty.servlet.ServletHolder. (ring.util.servlet/servlet handler))
(.setName "default"))
context (doto (org.mortbay.jetty.servlet.Context. server "/"
(bit-or org.mortbay.jetty.servlet.Context/SESSIONS
org.mortbay.jetty.servlet.Context/SECURITY))
(defroutes main-routes
(GET "/" req (index-html req))
(GET "/admin" req (example-html req))
(GET "/user" req (example-html req))
(GET "/other" req (example-html req))
(route/resources "/")
(route/not-found "Page not found"))