- §Enabling environments, games, and the Primer (58)
- §Note-writing systems (50)
- Evergreen notes (41)
- Enacted experience (37)
- Enabling environment (34)
- Mnemonic medium (30)
- Note-writing as fundamental unit of knowledge work (29)
- §Taking knowledge work seriously (Stripe convergence talk, 2019-12-12) (28)
- Evergreen notes should be densely linked (28)
- [The Primer isn’t
extension UIView { | |
func findFirstSuperview<T>(ofClass viewClass: T.Type, where predicate: (T) -> Bool) -> T? where T: UIView { | |
var view: UIView? = self | |
while view != nil { | |
if let typedView = view as? T, predicate(typedView) { | |
break | |
} | |
view = view?.superview | |
} |
(ns foo-test | |
(:require [cljs.spec :as s] | |
[cljs.spec.test :as stest] | |
[clojure.pprint :as pprint] | |
[cljs.test :refer-macros [deftest is]])) | |
;; Sample function and a function spec | |
(defn fooo [i] (+ i 20)) | |
(s/fdef fooo |
Rich Hickey on becoming a better developer | |
− | |
Avatar | |
Rich Hickey • 3 years ago | |
Sorry, I have to disagree with the entire premise here. | |
A wide variety of experiences might lead to well-roundedness, but not to greatness, nor even goodness. By constantly switching from one thing to another you are always reaching above your comfort zone, yes, but doing so by resetting your skill and knowledge level to zero. | |
Mastery comes from a combination of at least several of the following: |
Disclaimer: This is a personal perspective. The majority of OSS projects I contribute to are libraries and developer tooling. The side effect of this is that if a person is using one of these projects, they have the expertise to understand and modify the code of the project. Also many of the comments made are from my experience, your experience may vary.
;; SEE: https://github.com/cgrand/macrovich | |
;; macros and code in a single cljc working across clj, cljs and self-hosted cljs | |
;; require clojurescript from master | |
(ns foo.core | |
#?(:cljs (:require-macros | |
[net.cgrand.meta-macros :refer [macros no-macros]] | |
[foo.core :refer [add]]) | |
:clj (:require |
(ns shades.lenses) | |
; We only need three fns that know the structure of a lens. | |
(defn lens [focus fmap] {:focus focus :fmap fmap}) | |
(defn view [x {:keys [focus]}] (focus x)) | |
(defn update [x {:keys [fmap]} f] (fmap f x)) | |
; The identity lens. | |
(defn fapply [f x] (f x)) | |
(def id (lens identity fapply)) |
Find it here: https://github.com/bitemyapp/learnhaskell
ClojureScript does not have a standalone macro system. To write ClojureScript macros, one must write them in Clojure and then refer to them in ClojureScript code. This situation is workable, but at a minimum it forces one to keep ClojureScript code and the macros it invokes in separate files. I miss the locality of regular Clojure macros, so I wrote something called maptemplate
that gives me back some of what I miss. The technique may be useful in other scenarios.
Suppose you're wrapping functionality in another namespace or package so that you can have your own namespace of identically named but otherwise decorated functions:
ClojureScript:
In early November, 2012, Apple issued a graphics update for all mid-2012 MacBooks. In a continued streak of stupidity, however, this update forces your Mac to use "Safe Sleep". This means that the entire contents of your RAM is written to your disk every time you put your Mac to sleep. | |
This is retarded on the scale of the Titanic's navigational plan for two reasons: | |
1) Your Mac likely has 8 or 16GB of RAM. This is a ton of wasted disk space; especially on MacBook Airs that ship with only 256GB SSDs to begin with. | |
2) SSDs wear out as you write to them. Each cell of a SSD can only be written to a certain number of times before it becomes read-only. If you put your computer to sleep many times a day, OS X is slowly but surely destroying your SSD with unneeded write cycles. | |
Worst of all, the graphics update makes it IMPOSSIBLE to turn off safe sleep using the standard approach you'll find on Google: |