Skip to content

Instantly share code, notes, and snippets.

View edgargoncalves's full-sized avatar

Edgar Gonçalves edgargoncalves

  • https://www.businessdatapartners.com/
  • United Kingdom
View GitHub Profile
(defn init-app-engine
"Initialize the app engine services."
([] (init-app-engine "/tmp"))
([directory]
(let [proxy-factory (ApiProxyLocalFactory.)
environment (proxy [LocalServerEnvironment]
[]
(getAppDir [] (java.io.File. directory)))
api-proxy (.create proxy-factory environment)]
(ApiProxy/setDelegate api-proxy))))
(ns my-app.servlet
(:gen-class :extends javax.servlet.http.HttpServlet)
(:use ;; ring.adapter.jetty ;;uncomment this if you want a clojure jetty server
compojure.core
[hiccup core form-helpers page-helpers]
[ring.util.servlet :only [defservice]]
[ring.util.response :only [redirect]])
(:require [compojure.route :as route]
[appengine.users :as users]
[appengine.test :as test]
(defproject my-app "1.0.0-SNAPSHOT"
:description "A web application targetting the GAE, using its persistency layer."
:source-path "src"
:compile-path "war/WEB-INF/classes/"
:library-path "war/WEB-INF/lib/"
:dependencies [[org.clojure/clojure "1.2.0-master-SNAPSHOT"]
[org.clojure/clojure-contrib "1.2.0-SNAPSHOT"]
[compojure "0.4.0-SNAPSHOT"] ;; remove commons-fileupload before uploading to gae
[hiccup "0.2.4"]
[ring-gae "0.2.0"]
// Buxfer Slidebar jetpack, by Edgar Gonçalves
jetpack.future.import("slideBar");
function displayMessage(text) {
jetpack.notifications.show({title: 'Buxfer Jetpack',
body: text,
icon: 'https://www.buxfer.com/media/favicon/favicon-moneybag.ico'});
}
// Source code for Buxfer transaction posting with Ubiquity commands.
// By Edgar Gonçalves.
// Version 0.5
// Sun Jun 28 2009.
// Changes in 0.5: Parser2-ready, now.
// Roles, different syntax, selection is supported.
// Multiple suggestions bug fixed.
// Changes in 0.4: Redone command syntax. Now: "BUXFER-SPEND 43.2 IN something". Removed twixfer.
// Changes in 0.3: internal fixes, global variables unified into a single one, to avoid name clashes.
// Source code for the Priberam Ubiquity command
// By Edgar Gonçalves.
// Version 0.3
// Sun Jan 24 22:03:05 2010
// Adapted for new layout on the Priberam website (bugfix, preview wasn't working anymore - Thanks, Jorge Afonso).
// Version 0.2
// Sun Jun 28 2009
// Changed to use Parser 2 (requires Ubiquity 0.5 or above)