Server response
(defn generate-response [data & [status]]
{:status (or status 200)
:headers {"Content-Type" "application/edn"}
:body (pr-str {:1 "hi"})})
Server response
(defn generate-response [data & [status]]
{:status (or status 200)
:headers {"Content-Type" "application/edn"}
:body (pr-str {:1 "hi"})})
(om/build-all columns/columns-view (:columns data) {:init-state {:test "test"}}) | |
(defn columns-view [data owner] | |
(reify | |
om/IRenderState | |
(render-state [this {:keys [edit-header? show-input? test]}] | |
(println (om/get-state owner)) |
function addLiTemplate(content) { | |
var template = $("#li-template").clone() // this template is hidden insid the HTML markup with css {display:none;} | |
return template.find("#todo").text(content) | |
}; | |
// or | |
function addLiTemplate(content) { | |
$('<li/>', { | |
id: 'foo', | |
text: content |
(ns community.location | |
(:require [community.routes :as routes :refer [routes]] | |
[sablono.core :as html :refer-macros [html]])) | |
... | |
... | |
(defn init-location! [app-state] | |
(routes/set-route! app-state) | |
(.addEventListener js/window "popstate" (partial routes/set-route-and-clear! app-state))) |
(def app-state (atom {:board-name "Yo yo yo, get it done!" | |
:columns [{:name "To Do"} | |
{:name "Doing"} | |
{:name "Done"}]})) | |
(defn column-component [data owner] | |
(reify | |
om/IRender | |
(render [_] | |
(dom/div #js {:className "column"} |
(def app-state (atom {:board-info {:board-name "My Board" | |
:starred false | |
:private false} | |
:sidebar {:open true} | |
:columns [{:name "To Do" :cards [{:task "Sidebar" | |
:id 0} | |
{:task "Header" | |
:id 1} | |
{:task "Create new board" |
# setup 2 functions | |
def a | |
puts "hi vidal" | |
end | |
def b | |
return "hi vidal" | |
end |
function hiManish(fn, calls) { | |
var calls_count = calls; | |
return { | |
completeCall: function() { | |
calls -= 1; | |
if (this.isDone()){ | |
console.log("Begin to execute callback function") | |
fn.call(this) | |
} | |
}, |
We have a performance problem | |
Around 6 seconds. | |
This number belies two points. The first being that our site is slower than we would like it to be. The second is that it is not exact and gives us no idea of directionality. I’ll talk about each, in turn. | |
Our site is too slow. | |
Why in the age of cheap RAM, fast connections and copious caching is this the case. It should also be noted that while we are transitioning away from a separate mobile-only site, that the “around 6 seconds” number represents only our desktop users. |
FOLKS = %w( john | |
will | |
devin | |
nizar | |
pat | |
kai | |
sharell | |
hindi | |
chris | |
dave |