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 my-transducers.core | |
(:require [clojure.core.async :as async])) | |
;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
;; Understanding Transducers | |
;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
;; | |
;; This is the source code for the blog post Understanding Transducers, found | |
;; here: http://elbenshira.com/blog/understanding-transducers | |
;; |
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
(comment ; Fun with transducers, v2 | |
;; Still haven't found a brief + approachable overview of Clojure 1.7's new | |
;; transducers in the particular way I would have preferred myself - so here goes: | |
;;;; Definitions | |
;; Looking at the `reduce` docstring, we can define a 'reducing-fn' as: | |
(fn reducing-fn ([]) ([accumulation next-input])) -> new-accumulation | |
;; (The `[]` arity is actually optional; it's only used when calling | |
;; `reduce` w/o an init-accumulator). |
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
<!doctype html> | |
<style>body { padding: 0; }</style> | |
<script src='https://cdn.jsdelivr.net/p5.js/0.3.2/p5.min.js'></script> | |
<script src='out/goog/base.js'></script> | |
<script src='myproject.js'></script> | |
<script>goog.require('myproject.core')</script> |
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
(require '[schema.core :as s]) | |
(require '[schema.coerce :as coerce]) | |
(require '[schema.utils :as utils]) | |
(defn filter-schema-keys | |
[m schema-keys extra-keys-walker] | |
(reduce-kv (fn [m k v] | |
(if (or (contains? schema-keys k) | |
(and extra-keys-walker | |
(not (utils/error? (extra-keys-walker k))))) |
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
// JVM sizing options | |
-server -Xms40g -Xmx40g -XX:MaxDirectMemorySize=4096m -XX:PermSize=256m -XX:MaxPermSize=256m | |
// Young generation options | |
-XX:NewSize=6g -XX:MaxNewSize=6g -XX:+UseParNewGC -XX:MaxTenuringThreshold=2 -XX:SurvivorRatio=8 -XX:+UnlockDiagnosticVMOptions -XX:ParGCCardsPerStrideChunk=32768 | |
// Old generation options | |
-XX:+UseConcMarkSweepGC -XX:CMSParallelRemarkEnabled -XX:+ParallelRefProcEnabled -XX:+CMSClassUnloadingEnabled -XX:CMSInitiatingOccupancyFraction=80 -XX:+UseCMSInitiatingOccupancyOnly | |
// Other options | |
-XX:+AlwaysPreTouch -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintGCDateStamps -XX:+PrintTenuringDistribution -XX:+PrintGCApplicationStoppedTime -XX:-OmitStackTraceInFastThrow |
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
(scss->clj "/Users/noprompt/git/yui/pure/src/grids/css/grids-core.css" | |
'pure.grids) | |
;; => | |
((ns | |
pure.grids | |
(:require [garden.stylesheet] [garden.units] [garden.def])) | |
(garden.def/defstyles | |
grids | |
[".pure-g" | |
{:letter-spacing "-0.31em"} |
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
;; This is at: https://gist.github.com/8655399 | |
;; So we want a rhyming dictionary in Clojure. Jack Rusher put up | |
;; this code here: | |
;; | |
;; https://gist.github.com/jackrusher/8640437 | |
;; | |
;; I'm going to study this code and learn as I go. | |
;; | |
;; First I put it in a namespace. |
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
#lang typed/racket | |
;;; Typed Racket version of Martin Grabmü̈ller's "Algorithm W Step by Step" | |
;;; http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.65.7733 | |
;;; This is my first use of Typed Racket. I am looking to change this from | |
;;; following Haskell idiom to following Racket idiom. | |
;; An expression is a variable, a literal, an application, |
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 xn.test | |
(:require-macros [cljs.core.async.macros :refer [go alts!]] | |
(:require [xn.core :as xn] | |
[xn.util :as u] | |
[cljs.core.async :refer [<! take!]] | |
[xn.xhr :refer [request-body request-records chain-req]])) | |
(def sample-app | |
(reify | |
xn/Application |
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 n01se.externs-for-cljs | |
(:require [clojure.java.io :as io] | |
[cljs.compiler :as comp] | |
[cljs.analyzer :as ana])) | |
(defn read-file [file] | |
(let [eof (Object.)] | |
(with-open [stream (clojure.lang.LineNumberingPushbackReader. (io/reader file))] | |
(vec (take-while #(not= % eof) | |
(repeatedly #(read stream false eof))))))) |