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 / personal_list_gh_repos.py
Last active April 21, 2019 13:15
Lists all the repos, pub and priv, of a github user or organization. Prompts for password and/or 2FA token
from github3 import login
# Python 3
prompt = input
if __name__ == '__main__':
if len(sys.argv) > 1:
passwd = prompt('Enter password: ')
(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))))))