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 | |
# This automates the process of using Datomic Ions to push, deploy, and wait for | |
# the deployment to finish. It works as of com.datomic/ion.dev version 0.9.229. | |
# For more info, see https://docs.datomic.com/cloud/ions/ions.html | |
set -euxo pipefail | |
status_cmd=$(clj -A:dev -m datomic.ion.dev '{:op :push}' 2>&1 | \ | |
grep -v ^Downloading | \ |
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
// Goal: assign students to seats | |
// Usage: node before.js | |
// Context: UNC COMP 523 (https://comp523.cs.unc.edu) | |
// Exercise: refactor to manage effects better | |
const makePref = ([pid, section, isVip]) => | |
({pid, section, isVip, isAssigned: false}) | |
const makePrefs = (rows) => rows.map(makePref) |
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
;; To write tests for this function, what behaviors would you list? | |
(defn summation | |
([xs] (summation identity xs)) | |
([f xs] (reduce + 0 (map f xs)))) |
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
;; To write tests for this function, what behaviors would you list? | |
(defn pascal-row | |
"Return a seq of the numbers in the n-th row of Pascal's triangle (where n=0 is | |
the first row)." | |
[n] | |
(for [i (range (inc n))] | |
(combinations n i))) |
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 commits | |
(:require [clj-http.client :as http] | |
[clj-json.core :as json] | |
[clojure.pprint :refer [pprint]])) | |
(def api-url "https://api.github.com/repos/clojure/clojure/commits") | |
(defn get-committers-from-page [n] | |
(some->> (http/get api-url {:query-params {"per_page" 100, "page" n}}) | |
:body |
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 | |
set -euo pipefail | |
usage() { | |
echo "$(basename "$0") - Reload any Safari tabs that contain the given string." | |
echo "Usage:" | |
echo " $(basename "$0") STRING" | |
echo " fd <opts> | entr reload-safari-tab STRING" | |
} |
OlderNewer