Skip to content

Instantly share code, notes, and snippets.

View sundarj's full-sized avatar

Sundar Joshi sundarj

View GitHub Profile
@sundarj
sundarj / bret_victor-reading_list.md
Created June 28, 2018 22:02 — forked from nickloewen/bret_victor-reading_list.md
Bret Victor’s Reading List

This is a plain-text version of Bret Victor’s reading list. It was requested by hf on Hacker News.


Highly recommended things!

This is my five-star list. These are my favorite things in all the world.

A few of these works have had an extraordinary effect on my life or way of thinking. They get a sixth star. ★

;; Reducing function:
;; A function that takes an accumulator and an item and returns a new accumulator.
;; Like the function you would pass to reduce.
;; Transducer:
;; A function that takes a reducing function and
;; returns a new reducing function.
;; Slightly simplified, this is the meat of map with arity one.
@sundarj
sundarj / monoids.md
Created September 4, 2017 01:13 — forked from igstan/monoids.md

Monoids

A monoid is a type for which there exists:

  1. an associative binary operation, let's call it combine
  2. an identity element, let's call it neutral

Please note that it's the combination of an operation valid for that type with a particular instance of that type that forms a monoid, not just a type alone.

@sundarj
sundarj / inspect.clj
Created August 9, 2017 21:33 — forked from dkozma/inspect.clj
Clojure->Chrome Inspector
(ns inspect
(:require [cheshire.core :refer [generate-string]]
[clojure.java.io :as io])
(:import (java.net Socket)
(def host "localhost")
(def port 9000)
(defn cinspect [data]
(with-open [sock (Socket. host port)
@sundarj
sundarj / resources.md
Created July 28, 2017 22:54 — forked from teropa/resources.md
Clojure Resources

Tutorials

Rich Already Answered That!

A list of commonly asked questions, design decisions, reasons why Clojure is the way it is as they were answered directly by Rich (even when from many years ago, those answers are pretty much valid today!). Feel free to point friends and colleagues here next time they ask (again). Answers are pasted verbatim (I've made small adjustments for readibility, but never changed a sentence) from mailing lists, articles, chats. The link points back at them.

If you are talking about the aspect of pattern matching that acts as a conditional based upon structure, I'm not a big fan. I feel about them the way I do about switch statements - they're brittle and

(def inc-coll (partial map inc))
;;#'user/inc-coll
(inc-coll [4 5 6])
;;(5 6 7)
(def inc-coll-coll (partial map inc-coll))
;;#'user/inc-coll-coll
(inc-coll-coll [[1] [2]])
;;((2) (3))
(inc-coll-coll [[1] 3])
;;IllegalArgumentException Don't know how to create ISeq from: java.lang.Long clojure.lang.RT.seqFrom (RT.java:542)
@sundarj
sundarj / README.md
Created July 6, 2017 21:00 — forked from rduplain/README.md
Code Quarterly's 2011 Q&A with Rich Hickey, by Michael Fogus

From the Archives: Code Quarterly's 2011 Q&A with Rich Hickey

Rich Hickey is frequently quoted as saying:

You can reach a point with Lisp where, between the conceptual simplicity, the large libraries, and the customization of macros, you are able to write only code that matters. And, once there, you are able to achieve a very high degree of focus, such as you would when playing Go, or playing a musical instrument, or meditating. And then, as with those activities, there can be a feeling of elation that accompanies that mental state of focus.

@sundarj
sundarj / gist:4d88e44385570d315b6294d5746faa17
Created June 30, 2017 21:31 — forked from telent/gist:9742059
12 factor app configuration vs leaking environment variables
App configuration in environment variables: for and against
For (some of these as per the 12 factor principles)
1) they are are easy to change between deploys without changing any code
2) unlike config files, there is little chance of them being checked
into the code repo accidentally
3) unlike custom config files, or other config mechanisms such as Java