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 handle-file-select [evt] | |
| (.stopPropagation evt) | |
| (.preventDefault evt) | |
| (let [files (.-files (.-dataTransfer evt))] | |
| (dotimes [i (.-length files)] | |
| (let [rdr (js/FileReader.) | |
| the-file (aget files i)] | |
| (set! (.-onload rdr) | |
| (fn [e] | |
| (let [file-content (.-result (.-target e)) |
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
| #!/bin/bash | |
| # | |
| # (Above line comes out when placing in Xcode scheme) | |
| # | |
| # Inspired by original script by incanus: | |
| # https://gist.github.com/1186990 | |
| # | |
| # Rewritten by martijnthe: | |
| # https://gist.github.com/1379127 | |
| # |
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
| user=> (def buffer (StringBuilder.)) | |
| #'user/buffer | |
| user=> | |
| (defn appender [^StringBuilder buffer] | |
| (fn [& args] | |
| (when-let [arg (first args)] | |
| (.append buffer arg) | |
| (recur (rest args))))) | |
| user=> #'user/appender | |
| user=> |
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
| First, install nginx for mac with "brew install nginx". | |
| Then follow homebrew's instructions to know where the config file is. | |
| 1. To use https you will need a self-signed certificate: https://devcenter.heroku.com/articles/ssl-certificate-self | |
| 2. Copy it somewhere (use full path in the example below for server.* files) | |
| 3. sudo nginx -s reload | |
| 4. Access https://localhost/ | |
| Edit /usr/local/etc/nginx/nginx.conf: |
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 aws.s3 | |
| (:refer-clojure :exclude [get]) | |
| (:use [clojure.walk :only (keywordize-keys stringify-keys)] | |
| [clojure.contrib.def :only (defonce-)] | |
| [clojure.contrib.json :only (read-json write-json)]) | |
| (:import [java.io PrintWriter InputStreamReader ByteArrayInputStream ByteArrayOutputStream] | |
| [java.util.zip GZIPInputStream GZIPOutputStream] | |
| [com.google.common.base Charsets] | |
| [com.amazonaws.services.s3 AmazonS3Client] | |
| [com.amazonaws.services.s3.model Region CreateBucketRequest ObjectMetadata |
NewerOlder