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 app-state | |
(atom {:form {:email {:label "Email" | |
:error "invalid email" | |
:value "[email protected]"}}})) | |
(defn form-element [key] | |
(reagent/cursor app-state [:form key])) | |
(def cur (form-element :email)) |
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 prototype.graph | |
(:use vijual) | |
(:import [javax.swing JFrame JLabel] | |
java.awt.image.BufferedImage | |
java.awt.Dimension)) | |
(defn draw [] | |
(let [frame (new JFrame) | |
image (draw-tree-image [[:north-america [:usa [:miami] [:seattle] [:idaho [:boise]]]] [:europe [:germany] [:france [:paris] [:lyon] [:cannes]]]]) | |
canvas (proxy [JLabel] [] (paint [g] (.drawImage g image 0 0 this))) |
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.core | |
(:use clojure.test) | |
(:require [clojure.string :as s])) | |
(defn clean-component [component] | |
(s/replace component #"/+" "")) | |
(defn path-prefix [components] | |
(if (re-find #"/+" (first components)) | |
"/" |
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 facebook-app-info {:client-id "107582059321384" | |
:client-secret "2022b10bce2b619aa9aee7b8a5f13aa7" | |
:redirect-uri "http://localhost:8080/facebook-callback" | |
:permissions ["user_photos" "friends_photos"]}) |
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://localhost:8080/albums/Max_Mustermann | |
http://localhost:8080/albums/me |
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
clj-facebook-graph.example> (with-facebook-auth-by-name "Max Weber" | |
(client/get [:me :likes] {:query-params {:limit 2} :extract :data :paging true})) |
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
clj-facebook-graph.example> (with-facebook-auth-by-name "Max Weber" (client/get [:me :home])) |
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
clj-facebook-graph.example> (with-facebook-auth-by-name "Max Weber" (client/get [:me :friends])) |
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
(with-facebook-auth {:access-token "134211159981787|2._UqBc68omALVTLR_FM6DZg__.3600.129951..."} | |
(client/get "https://graph.facebook.com/me/friends")) |
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
clj-facebook-graph.example> (with-facebook-auth-by-name "Max Weber" (client/get "https://graph.facebook.com/me/friends")) | |
{:status 200, :headers {"content-type" "text/javascript; charset=UTF-8", | |
"date" "Mon, 07 Mar 2011 15:56:41 GMT", | |
"cache-control" "private, no-cache, no-store, must-revalidate", | |
"expires" "Sat, 01 Jan 2000 00:00:00 GMT", | |
"etag" "\"bb3aff0d25be9397d666254583743b7a8bcfb60e\"", | |
"x-powered-by" "HPHP", "content-length" "4462", | |
"pragma" "no-cache", "connection" "close", "x-fb-server" "10.32.53.102"}, | |
:body {:data [{:name "Friend 1", :id "id of friend one"} {:name "Friend 2", :id "id of friend two"} ... |