Skip to content

Instantly share code, notes, and snippets.

@rathwell
rathwell / data.clj
Created February 27, 2011 17:47
generic key-value store data access library, currently using simpledb
(ns xxx.data
"Core functionality for working with data store entities"
(:gen-class)
(:require [xxx.vendor.aws.sdb :as sdb]
[xxx.vendor.aws.common :as aws-common]
[xxx.config.vendor :as config]
[xxx.util.core :as util]))
(def aws-credentials (aws-common/get-basic-credentials
config/aws-access-key-id config/aws-secret-access-key))
(ns noir.server
"A collection of functions to handle Noir's server and add middleware to the stack."
(:use compojure.core
;;clojure.java.io
;;clojure.tools.namespace
;;ring.adapter.jetty
ring.middleware.file-info
ring.middleware.reload-modified
ring.middleware.file)
(:use [clojure.java.io :only (file resource)]
pinot.events.match_QMARK_ = function(a, b) {
for(var c = cljs.core.truth_(cljs.core.seq_QMARK_.call(null, a)) ? cljs.core.apply.call(null, cljs.core.hash_map, a) : a, d = cljs.core.get.call(null, c, "\ufdd0'pinotId"), e = cljs.core.get.call(null, c, "\ufdd0'pinotGroup"), f = cljs.core.get.call(null, c, "\ufdd0'elem"), g = b;;) {
var h = pinot.html.attr.call(null, g, "\ufdd0'pinotGroup"), i = pinot.html.attr.call(null, g, "\ufdd0'pinotId");
if(cljs.core.truth_(cljs.core.not_EQ_.call(null, g, pinot.html.parent.call(null, pinot.events.get_body.call(null))))) {
bootstrap.js:12495Uncaught TypeError: Cannot call method 'call' of undefined
if(cljs.core.truth_(function() {
var a = cljs.core.truth_(f) ? cljs.core._EQ_.call(null, f, g) : f;
return cljs.core.truth_(a) ? a : (a = cljs.core.truth_(e) ? cljs.core._EQ_.call(null, e, h) : e, cljs.core.truth_(a) ? a : cljs.core.truth_(d) ? cljs.core._EQ_.call(null, d, i) : d)
}())) {
return g
(ns foo.views.image
(:use [noir.core :only (defpartial defpage)])
(:require [hiccup.core :as hc]
[foo.views.imagemodel :as im])
(:import [foo.views.imagemodel ImageRecord]))
(defpartial image-item [{:keys [alt src width height]}]
[:img {:src src :width width :height height}])
(defpartial image-list [images]
@rathwell
rathwell / app_servlet.clj
Created April 11, 2012 02:54
Noir differences for GAE: app_servlet ns generated by lein appengine-new, and httpsession middleware for clustered environments. After running lein appengine-new, make the changes to app_servlet, and add the other 2 files to your project.
(ns my.ns.app_servlet
(:gen-class :extends javax.servlet.http.HttpServlet)
(:use [appengine-magic.servlet :only [make-servlet-service-method]]
[appengine-magic.multipart-params :only [wrap-multipart-params]])
(:require [appengine-magic.core :as gae]
[noir.util.gae :as noir-gae]
[noir.server.handler :as handler]
[my.ns.middleware.httpsession :as httpsession]))
;; custom middlewares
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
/// <summary>
/// Python or Javascript may have been a bit tighter, but the concept is the same
/// </summary>
public class Program
{
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
/// <summary>
/// Python or Javascript may have been a bit tighter, but the concept is the same
/// </summary>
public class Program
{