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
(defproject one "1.0.0-SNAPSHOT" | |
:description "Getting Started with ClojureScript." | |
:dependencies [[org.clojure/clojure "1.4.0"] | |
[ring "1.1.5"] | |
[compojure "1.1.3"] | |
[org.clojure/clojurescript "0.0-1450"] | |
[enlive "1.0.1"] | |
[domina "1.0.1-SNAPSHOT"] | |
[org.mozilla/rhino "1.7R3"] | |
[com.google.javascript/closure-compiler "r2079"] |
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
(defproject one "1.0.0-SNAPSHOT" | |
:description "Getting Started with ClojureScript." | |
:dependencies [[org.clojure/clojure "1.4.0"] | |
[ring "1.1.5"] | |
[compojure "1.1.3"] | |
[enlive "1.0.0"] | |
[domina "1.0.0"] | |
[org.mozilla/rhino "1.7R3"] | |
[com.google.javascript/closure-compiler "r1918"] | |
[org.clojure/google-closure-library "0.0-1376-2"]] |
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
sync: function(method, model, options) { | |
if (method == "update" || method == "create") { | |
var params = {type: "POST", dataType: "json", "url": ___ROOT_URL___ + "/login", | |
contentType: 'application/json', data: JSON.stringify(model.toJSON()), | |
processData: false | |
}; | |
return $.ajax(_.extend(params, options)); | |
} else { |
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
http://www1.shoppersdrugmart.ca/en/store-locator/store-58.aspx | |
http://www1.shoppersdrugmart.ca/en/store-locator/store-6.aspx | |
http://www1.shoppersdrugmart.ca/en/store-locator/store-18.aspx | |
http://www1.shoppersdrugmart.ca/en/store-locator/store-50.aspx | |
http://www1.shoppersdrugmart.ca/en/store-locator/store-54.aspx | |
http://www1.shoppersdrugmart.ca/en/store-locator/store-105.aspx | |
http://www1.shoppersdrugmart.ca/en/store-locator/store-27.aspx | |
http://www1.shoppersdrugmart.ca/en/store-locator/store-7.aspx | |
http://www1.shoppersdrugmart.ca/en/store-locator/store-156.aspx | |
http://www1.shoppersdrugmart.ca/en/store-locator/store-2.aspx |
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
;; The ->> threading macro will normally place the previous form into the last argument position of the next form | |
;; However, there are times when you are working with functions that don't take the required parameter in the last spot | |
;; In this example, I'm extracting all path locations before /v | |
;; re-seq first and second all work with the threading macro | |
;; However, when it comes time to split the string result, clojure.string/split takes two arguments | |
;; The first is the string, and the second is the regular expression to split on. | |
;; For the threading macro to work as is, these arguments need to be reversed | |
;; One way of doing this is creating an anonymous function that does this | |
;; #(clojure.string/split % #"/") This is the function | |
;; Then you actually evaluate by wrapping it in paranthesis |
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
;; You can't use map or vector binding in the params of a datomic function map. It will cause a | |
;; 'clojure.lang.PersistentVector cannot be cast to java.lang.Stringclojure.lang.PersistentVector cannot be cast to java.lang.String | |
;; For example, I was attempting ot create a function so that I could pass the following to the transactor function: | |
;; (d/transact *conn* [ [:node/add {:node/description "Hello" :node/uri "http://www.example.com" :node/tags ["tag1", "tag2"]]]) | |
;; This causes an error, because params isn't being treated like it can be bound to. You can only specify symbols to bind to | |
(def add-node {:db/doc "A function for adding a node to the database" | |
:db/ident :node/add | |
:db/fn (d/function '{:lang :clojure | |
:params [db [{:keys [uri description tags prerequisites]}]] |
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
(defn recursive-rule | |
"A recursive rule for establishing prototype inheritance/isa relationship. | |
Can specify a maximum depth to travel, or none if there are no restrictinos. | |
rule The name of the rule | |
e The entity | |
a The attribute | |
v The value | |
Should be creating the rule like: (recursive-rule 'isa '?e '?a '?v) | |
Then within a query, can refer to it like this: | |
(isa ?e :thing/isa ?v) " |
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-material-ui.core | |
(:require [clojure.string :as str] | |
[om-tools.dom :as omt])) | |
(defn kebab-case | |
"Converts CamelCase / camelCase to kebab-case" | |
[s] | |
(str/join "-" (map str/lower-case (re-seq #"\w[a-z]+" s)))) | |
(def material-tags |
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
(function () { | |
var React = require('react'), | |
injectTapEventPlugin = require("react-tap-event-plugin"), | |
materialUI = require('material-ui'); | |
//Needed for React Developer Tools | |
window.React = React; | |
window.MaterialUI = materialUI; |
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 path.to.services.env | |
(:require | |
[clojure.tools.logging :as log] | |
[puppetlabs.trapperkeeper.core :as tk] | |
[puppetlabs.trapperkeeper.services :as s])) | |
(defprotocol EnvironmentConfigService | |
(get-config [this] | |
"Returns a map containing all of the configuration values (enviornmentally aware). Any string value that is | |
prefixed by ENV_, will be considered an environmental variable.") |
OlderNewer