This file contains hidden or 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 preview-essay-body [] | |
(let [body-el (dom/getElement "body_id") | |
preview-el (dom/getElement "preview_pane") | |
b-txt (.value body-el) | |
safe "false"] | |
(dom/removeChildren preview-el) | |
(dom/appendChild | |
preview-el | |
(dom/htmlToDocumentFragment | |
(js* "new Showdown.converter().makeHtml(~{b-txt},~{safe})"))))) |
This file contains hidden or 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 essay [slug] | |
(render-request | |
(temp/base {:title "Essay" | |
:navigation (temp/nav) | |
:content (temp/essay [(essays/fetch slug)])})) | |
(def core | |
(app | |
wrap-params | |
(wrap-static "src/alen_blog/static" ["/js" "/css"]) |
This file contains hidden or 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 do-build-slug [s] | |
(if-let [slug-el (dom/getElement "slug_id")] | |
(.value slug-el (js* "~{s}.replace(/^\\s+|\\s+$/g, '').replace(/[^a-z0-9 -]/g, '').replace(/\\s+/g, '-').replace(/-+/g, '-')")))) |
This file contains hidden or 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
:dependencies [[org.clojure/clojure "1.2.1"] ;"1.3.0-beta1" | |
[org.clojure/clojure-contrib "1.2.0"] | |
[enlive "1.0.0"] | |
[net.cgrand/moustache "1.0.0"] | |
[postgresql "8.4-701.jdbc4"] | |
[org.clojure/java.jdbc "0.0.5"] | |
[ring/ring-core "0.3.11"] | |
[ring/ring-devel "0.3.11"] | |
[ring/ring-jetty-adapter "0.3.11"]] | |
:dev-dependencies [[swank-clojure "1.4.0-SNAPSHOT"]] |
This file contains hidden or 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 jquerytest.core) | |
(def jquery (js* "$")) | |
(jquery | |
(fn [] | |
(-> (jquery "div.meat") | |
(.html "This is a test.") | |
(.append "<div>Look here!</div>")))) |
This file contains hidden or 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 blog | |
(:require | |
[goog.Uri :as uri] | |
[goog.net.XhrIo :as xhrIo] | |
[goog.events :as events] | |
[goog.dom :as dom])) | |
(def essays-uri (goog.Uri. "http://localhost:8080/essays/part")) | |
(defn retrieve [url callback] |
This file contains hidden or 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
Write a program that prints the numbers from 1 to 100. But for multiples of three print "Ham" instead of the number and for the multiples of five print "Jam". For numbers which are multiples of both three and five print "HamJam". |
This file contains hidden or 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
Process: TermKit [41551] | |
Path: /Users/alen/Development/javascript/node/TermKit/Build/TermKit.app/Contents/MacOS/TermKit | |
Identifier: net.acko.TermKit | |
Version: 0.3.2-alpha (0.3.2) | |
Code Type: X86-64 (Native) | |
Parent Process: launchd [147] | |
Date/Time: 2011-05-19 13:20:52.676 +0200 | |
OS Version: Mac OS X 10.6.6 (10J567) | |
Report Version: 6 |
This file contains hidden or 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
module Main | |
where | |
import Data.Maybe (isNothing, fromJust) | |
import Data.List (intercalate) | |
import Char (toUpper) | |
import System.IO (hFlush, stdout) | |
data Move = O | X | |
deriving (Eq, Show, Enum, Ord) |
This file contains hidden or 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
SELECT r.name, b.amount_incl_tax, | |
(SELECT l.name from labeling_label l INNER JOIN labeling_labeleditem li | |
ON li.label_id=l.id AND li.object_id=b.id AND li.content_type_id=28 LIMIT 1) AS labels | |
FROM billing_genericbill b | |
INNER JOIN billing_recipient r ON b.recipient_id=r.id | |
ORDER BY labels |