This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Exception in thread "main" java.lang.NoClassDefFoundError: clout/core/Route | |
at composur.routes.auth__init.load(Unknown Source) | |
at composur.routes.auth__init.<clinit>(Unknown Source) | |
at java.lang.Class.forName0(Native Method) | |
at java.lang.Class.forName(Class.java:270) | |
at clojure.lang.RT.loadClassForName(RT.java:2098) | |
at clojure.lang.RT.load(RT.java:430) | |
at clojure.lang.RT.load(RT.java:411) | |
at clojure.core$load$fn__5018.invoke(core.clj:5530) | |
at clojure.core$load.doInvoke(core.clj:5529) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Posts.find({}, { | |
fields: { | |
upvoters: { | |
$elemMatch: { | |
id: userId //userId is the current user's id. | |
} | |
} | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns om-tutorial.core | |
(:require [goog.dom :as gdom] | |
[om.next :as om :refer-macros [defui]] | |
[om.dom :as dom])) | |
(enable-console-print!) | |
(def init-data | |
{:list/one [{:name "John" :points 0} | |
{:name "Mary" :points 0} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//============================================================================== | |
// template utilities | |
// making Meteor's template api a bit less, well, awful | |
//============================================================================== | |
define([ | |
"lib/ext" | |
], | |
function(ext){ | |
"use strict"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!--Whole application shares this markup: --> | |
<body> | |
<ul id="nav"> | |
<li>Home</li> | |
<li>Other Page</li> | |
</ul> | |
<div id="content"></div> | |
</body> | |
<!-- Home Page 'focus' --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; definition of Layout component - the root component for the application | |
(defr Layout | |
[component prop _] | |
[:div.nav-slide-wrap {:on-click handle-body-clicks} | |
;; a sub component - it's passed the entire `prop` even though it | |
;; doesn't need all of it. Eventually it'll be smart for me to only pass the necessary data to components. | |
[Nav prop] | |
[:div {:class-name (str "main-body " (if (:user prop) "signedIn" "notSignedIn"))} | |
[Header prop] | |
[Content prop] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(def datasources (agent {})) | |
(defn make-datasource [db-conf] | |
(send-off datasources | |
(fn [datasources] | |
(if-let [ds-conf (get datasources db-conf)] | |
(update-in datasources [db-conf :count] inc) | |
(assoc datasources | |
db-conf {:count 1 | |
:ds (conn-pool/make-datasource db-conf)})))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var | |
// "appstate" object | |
obj = {}, | |
// data-level onChange handler - doesn't deal w/ the dom. | |
onChange = function(newValue){ obj.attr = newValue; }, | |
// start function that deals with the dom and calls the data-level event handler | |
start = function(handler){ | |
$(".selector").on("change", function(e){ | |
e.preventDefault(); | |
handler(e.target.value); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; I'm not using Om yet because I've got a lot of code using Pump and just haven't made the transition, | |
;;; but the principles are all the same. So you'll see Pump-specific code here. | |
(def code->key | |
"map from a character code (read from events with event.which) | |
to a string representation of it. | |
Only need to add 'special' things here." | |
{13 "enter" | |
37 "left" | |
38 "up" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns ansible.core | |
(:require [clojure.java.shell :as sh] | |
[clojure.string :as str] | |
[cheshire.core :as cheshire] | |
[clojure.java.io :as io]) | |
(:import (java.io File) | |
(com.fasterxml.jackson.core JsonGenerator) | |
(java.util Base64) | |
(java.security MessageDigest MessageDigest$Delegate))) |
OlderNewer