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
ackage cr.canopy.tunde.canopy.manager; | |
import android.content.res.AssetManager; | |
import android.support.v4.app.FragmentActivity; | |
import android.util.Log; | |
import java.io.File; | |
import java.io.FileOutputStream; | |
import java.io.IOException; | |
import java.io.InputStream; |
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
(defn format-history-lines | |
[history-lines] | |
((comp | |
format-history-map | |
(partial take 10) | |
sort-by-weight | |
counts | |
(partial map history-line->command)) | |
history-lines)) |
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
/* Smartphones (landscape) ----------- */ | |
@media only screen and (min-width : 321px) and (max-device-width: 569px) { | |
/* Styles */ | |
} | |
/* Smartphones (portrait) ----------- */ | |
@media only screen and (max-width : 320px) and (max-device-width: 320px) { | |
/* Styles */ |
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 twansit.server.handler) | |
(defmacro respond-with | |
[& body] | |
(let [args (or (last (filter vector? body)) ['req 'res]) | |
res-code (or (last (filter integer? body)) 200) | |
headers (merge {:Content-Type "text/html; charset=UTF-8"} | |
(or (last (filter map? body)) {})) | |
output (or (last (filter list? body)) | |
(last (filter string? body)) "") |
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
/* | |
* * JavaScript Pretty Date | |
* * Copyright (c) 2008 John Resig (jquery.com) | |
* * Licensed under the MIT license. | |
* */ | |
// Takes an ISO time and returns a string representing how | |
// long ago the date represents. | |
function prettyDate(time){ |
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
(defn wait-for-changes | |
[& _] | |
(let [update-seq (:update_seq (database-info "test-changes"))] | |
(with-open [is (with-db "test-changes" | |
(couchdb-request (assoc config :read-json-response false) | |
:get (str "_changes?feed=continuous&heartbeat=5000&since=" update-seq)))] | |
(loop [lines (io/read-lines is)] | |
(if-let [line (first lines)] | |
line | |
(recur lines)))))) |
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
(defmulti watch-changes | |
"Provided a database (database meta, java.net.URL, or database name) and a callback, watches | |
for changes to the database and executes the given callback (takes one argument) on every change | |
to a document in the given database, using the meta of the changed document as the only | |
argument of the callback." | |
database-arg-type) | |
(defn- watch-changes-handler | |
[url-str agnt] | |
(if (h/success? agnt) |
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
(defmulti watch-changes | |
"Provided a database (database meta, java.net.URL, or database name) and a callback, watches | |
for changes to the database and executes the given callback (takes one argument) on every change | |
to a document in the given database, using the meta of the changed document as the only | |
argument of the callback." | |
database-arg-type) | |
(defn- watch-changes-handler | |
[url-str agnt] | |
(if (h/success? agnt) |
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 contest | |
(:require [clojure.contrib.str-utils :as s]) | |
(:import (java.math BigInteger) | |
(java.util.concurrent ScheduledThreadPoolExecutor))) | |
(def *phrase-int* (BigInteger. (com.ashafa.SHA1/hash "I would much rather hear more about your whittling project") 16)) | |
(def *words-list* (vec (.split #"\r?\n" (slurp "words.txt")))) | |
(def *words-count* (count *words-list*)) |
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 clojure-couchdb | |
(:use com.ashafa.couchdb | |
(clojure.contrib [test-is :as test-is]))) | |
(set-couchdb-config! {:language "clojure"}) | |
(def test-doc-1 {:name "John Smith" | |
:email "[email protected]" | |
:score 65}) |
NewerOlder