Coming from a Haskell background and landing on Clojure-land, I had a lot of difficulty grasping some design decisions, specially regarding parameter order and the use of threading macros. This post aims to shed a light on some design decisions Clojure took and reason about whether or not, how or when should you use thread macros. This is an entirely personal opinion, but reasonable arguments are given.
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
Fantasy Heartbreaker | |
Vague Aggregate | |
I’d Ship It | |
Vargr | |
Hanzo Main | |
Horny on Main | |
Dump Stat | |
Trap Street | |
Event Horizon | |
Cherenkov Blue |
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 | |
# Disable macOS Upgrade notifications | |
# Step 1: prevent the update which brings the notification down | |
softwareupdate --ignore macOSInstallerNotification_GM | |
echo | |
# Step 2: delete the file if it's already on the computer |
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
Lord Meg | |
Dodger | |
Dodgem | |
Husk | |
Husker | |
Dusk | |
Drain | |
Clamp | |
Beetle | |
Bell |
in OS X 10.4 to macOS sierra 10.12 and maybe higher!
Copy this entire code block and paste it into your terminal and push Return to create this file for you with correct permissions. It will (probably) ask for your password:
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 app.logging | |
(:refer-clojure :exclude [time]) | |
(:require #?(:clj [clojure.tools.logging :as log] | |
:cljs [goog.log :as glog])) | |
#?(:cljs (:import goog.debug.Console))) | |
#?(:cljs | |
(def logger | |
(glog/getLogger "app"))) |
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 interop.core | |
(:require [cljs.nodejs :as nodejs])) | |
(nodejs/enable-util-print!) | |
(def Immutable (js/require "immutable")) | |
(extend-type Immutable.List | |
ISeqable | |
(-seq [coll] |
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 listen-file-drop | |
([el] (listen-file-drop el (chan))) | |
([el out & {:keys [concat] | |
:or {concat true}}] | |
(let [handler (events/FileDropHandler. el true)] | |
(events/listen el events/FileDropHandler.EventType.DROP | |
(fn [e] (let [files (event->files e)] | |
(.log js/console "dropped") | |
(.log js/console (-> (-source-event e) .-dataTransfer .-files prim-seq)) | |
(if concat |
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
(require '[clojure.test :as test]) | |
; Rewrite clojure.test to generate data structures instead of writing to | |
; stdout | |
(def ^:dynamic *results* | |
"Bound dynamically to an atom wrapping a vector of test report maps") | |
(defn add-name | |
"Given a testing report map, assoc's on a :name derived from the current | |
`clojure.test/testing` context." |
NewerOlder