Skip to content

Instantly share code, notes, and snippets.

View nickbauman's full-sized avatar
🎯
Focusing

Nick Bauman nickbauman

🎯
Focusing
View GitHub Profile
@nickbauman
nickbauman / ios_imperatives_for_approval.md
Last active November 1, 2019 12:10
Condensed iOS Human Interface Guidelines, formulated as imperatives.

Condensed iOS Human Interface Guidelines

Imperatives for AppStore approval

For iPhone app developers. Emphasis on getting the fastest app store approval. Everything stated as suggestion made into an imperative. When "violating" these imperatives, you can check for yourself what the caveats are. Generally speaking, deviating will more likely cause your app to be hung up in approval.

You can read this entire document in about 20 minutes. This is faster than reading and understanding the entire Human Interface Guidelines.

Overview

(ns haversine
(:require [math.numeric-tower :refer [expt sqrt]]))
(def RADIUS_OF_EARTH 6371.0088)
(defn radians [degrees]
(/ (* degrees Math/PI) 180))
(defn haversine
[lat1 lon1 lat2 lon2]
@nickbauman
nickbauman / anagram.clj
Created November 15, 2021 22:15
Clojure anagram detector
(defn split-string [word]
(into #{} (clojure.string/split word #"")))
(defn anagram-of? [word candidate]
(boolean (when (= (count word) (count candidate))
(let [word-list (split-string word)
cand-list (split-string candidate)]
(= #{} (clojure.set/difference cand-list word-list))))))