Skip to content

Instantly share code, notes, and snippets.

View wilkerlucio's full-sized avatar

Wilker Lúcio wilkerlucio

View GitHub Profile
(defn show-lookup [path]
(->> (scandir path)
(r/filter is-file?)
(r/filter has-video-extension?)))
(ns joy.unit-testing
(:require [joy.futures :as joy]))
(def stubbed-feed-children
(constantly [{:content [{:tag :title
:content ["Stub"]}]}]))
(defn count-feed-entries [url]
(count (joy/feed-children url)))
var Template = {
compile: function(string, builder) {
var rootNode = $(string);
var map = {};
rootNode.find("[data-binding]").each(function () {
var el = $(this);
var bindingName = el.data("binding");
var Template = {
compile: function(string, builder) {
var rootNode = $(string);
var map = {};
rootNode.find("[data-binding]").each(function () {
var el = $(this);
var bindingName = el.data("binding");
var templateString = $("#person-template").html();
<script type="x-template" id="person-template">
<div>
<div>Name: <span data-binding="name"></span></div>
<div>Email: <span data-binding="email"></span></div>
</div>
</script>
(def frozen-pizza-recipe
{:title "Frozen Pizza"
:steps #_ ?})
(def frozen-pizza-recipe
{:title "Frozen Pizza"
:steps [{:at 600 :message "put the pizza in!"}
{:at 1320 :message "pizza ready, take it out!"}]})
(ns travel-buddy.core
(:require [liberator.core :refer [resource defresource]]
[liberator.dev :refer [wrap-trace]]
[ring.middleware.params :refer [wrap-params]]
[ring.adapter.jetty :refer [run-jetty]]
[compojure.core :refer [defroutes ANY]]
[hiccup.core :refer [html]]))
(def home-template
[:html
(page "index.html")
(defelem cell-input [{:keys [cell] :as attrs}]
(let [target-value #(do! (-> % .-currentTarget) :value)]
(input :type (:type attrs "text")
:value cell
:on-input #(reset! cell (target-value %)))))
(defn form-input
([& {:keys [validator] :or {validator (fn [_] true)}}]