Skip to content

Instantly share code, notes, and snippets.

View wilkerlucio's full-sized avatar

Wilker Lúcio wilkerlucio

View GitHub Profile
class @Rectangle
constructor: (@left, @top, @width, @height) ->
expand: (amount) ->
yamount = amount / @width * @height
new Rectangle(
@left - amount
@top - yamount
@width + amount * 2
class @Rectangle
@fromClientRect: (clientRect) ->
new Rectangle(
clientRect.left
clientRect.top
clientRect.right - clientRect.left
clientRect.bottom - clientRect.top)
@fromNode: (node) ->
{left, top} = node.offset()
{
"estados": [
{
"sigla": "AC",
"nome": "Acre",
"cidades": [
"Acrelândia",
"Assis Brasil",
"Brasiléia",
"Bujari",
var express = require('express');
var path = require('path');
var app = express();
var directory = path.resolve(process.argv[2] || ".");
var port = process.argv[3] || 8888;
console.log("Serving", directory);
app.use('/', express.static(directory));
(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)}}]
(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
(def frozen-pizza-recipe
{:title "Frozen Pizza"
:steps [{:at 600 :message "put the pizza in!"}
{:at 1320 :message "pizza ready, take it out!"}]})
(def frozen-pizza-recipe
{:title "Frozen Pizza"
:steps #_ ?})
<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>
var templateString = $("#person-template").html();