Skip to content

Instantly share code, notes, and snippets.

@scttnlsn
scttnlsn / core.cljs
Last active July 2, 2016 07:36
Om/Secretary nested routing
(ns nested-routing.core
(:require-macros [om.core :as om]
[secretary.core :refer [defroute]])
(:require [om.dom :as dom]
[om.core :as om]
[secretary.core :as secretary]
[goog.events :as events]
[goog.history.EventType :as EventType])
(:import goog.History))
@bhauman
bhauman / README.md
Last active December 3, 2019 16:43
ClojureScript minimal dev and prod setup.

Recent improvements to the ClojureScript compiler have greatly simplified setting up development versus production outputs.

This example uses Figwheel as something that you want to exclude for production, but the pattern is general.

With this simple setup you only need one html file/view and it will work for developement and production.

@zentrope
zentrope / index.html
Last active July 18, 2016 17:33
HelloWorld Cordova ClojureScript
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="format-detection" content="telephone=no" />
<meta name="msapplication-tap-highlight" content="no" />
<!-- WARNING: for iOS 7, remove the width=device-width and
height=device-height attributes. See
https://issues.apache.org/jira/browse/CB-4323 -->
<meta name="viewport"
@ptaoussanis
ptaoussanis / transducers.clj
Last active December 8, 2024 03:24
Quick recap/commentary: Clojure transducers
(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).
(require '[clojure.core.async :as a])
(def xform (comp (map inc)
(filter even?)
(dedupe)
(flatmap range)
(partition-all 3)
(partition-by #(< (apply + %) 7))
(flatmap flatten)
(random-sample 1.0)
@GEverding
GEverding / d3-fun.cljs
Created July 13, 2014 04:34
d3.js + reactjs/om + clojurescript
(defn graph [app owner opts]
(reify
om/IInitState
(init-state [_]
(let [data (:data app)
width (:width opts)
height (:height opts)
x (-> d3 .-time (.scale) (.range [0 width]))
y (-> d3 .-scale (.linear) (.range [height 0])) ]
{:width width
@staltz
staltz / introrx.md
Last active May 11, 2025 22:46
The introduction to Reactive Programming you've been missing
@carlynorama
carlynorama / IntelGalileoConnectionSettings.stc
Created March 10, 2014 23:12
CoolTerm Settings for IntelGalileo
Port = YOURPORT
BaudRate = 115200
DataBits = 8
Parity = N
StopBits = 1
FlowControlCTS = false
FlowControlDTR = false
FlowControlXON = false
DTRDefaultState = true
RTSDefaultState = true
@nlothian
nlothian / Penn Treebank II Tags.md
Last active April 15, 2025 13:39
Penn Treebank II Tags