Skip to content

Instantly share code, notes, and snippets.

View sduckett's full-sized avatar
📡

sduckett

📡
  • 12:05 (UTC -06:00)
View GitHub Profile
@sduckett
sduckett / geospatial-data.org
Last active June 10, 2017 16:38
Some interesting geospatial data sets

Exploring Geospatial Data with Python and QGIS

State Boundaries

There is a shapefile describing State Boundaries of the United States. Load it and see if you can answer the following questions.

  1. In what order were the States of the United States admitted to the union?
  2. How much land area is contained within the boundaries of the United States?
  3. What is the mapping of name to state fips?

With QGIS

Keybase proof

I hereby claim:

  • I am sduckett on github.
  • I am sduckett (https://keybase.io/sduckett) on keybase.
  • I have a public key whose fingerprint is 4B8A 9A48 910A 9820 5C1A 9E60 8425 842D 6886 EF4C

To claim this, I am signing this object:

@sduckett
sduckett / clojure-dev.md
Last active October 13, 2015 18:19
Clojure Dev Environment / Workflows

Found a thread about setting up a Clojure Dev Environment. The responses include

  • use component and tools.namespace together
  • use an nREPL connection through your editor of choice, and if running clj-autotest it should be able to communicate with the same nREPL connection, so you can have the tools handle most of the test running, etc; the REPL tends to be used for the exploratory stuff.
  • Sean Corfield keeps his REPL in the user namespace. each namespace that's being worked on is (required) in the repl, and expressions from the file are evaluated in the repl.
  • you can build a Leiningen template with the setup that works for you (testing tools, REPL initialization, etc.) If you took this approach, you could have both a library (the code you're working on) and a developme
@sduckett
sduckett / haversine.clj
Created October 1, 2015 02:22
Some Clojure with a lot of Greek letters.
(defn haversine
"The haversine distance between two geographical points 1 and 2;
see <https://en.wikipedia.org/wiki/Haversine_formula>"
[p1 p2]
(let [φ1 (p1 :lat)
λ1 (p1 :lon)
φ2 (p2 :lat)
λ2 (p2 :lon)
Δλ (Math/toRadians (- λ2 λ1))
Δφ (Math/toRadians (- φ2 φ1))
@sduckett
sduckett / gist:327cd9894894cce5c10c
Created July 30, 2015 18:53
Markdown is not much of a CLI tool
┌[smd@amdi] [/dev/pts/2] [gh-pages ⚡]
└[~/clojurebridge/curriculum/outline]> markdown --help
Can't open --help: No such file or directory at /usr/bin/markdown line 218.
Use of uninitialized value $text in substitution (s///) at /usr/bin/markdown line 245.
Use of uninitialized value $text in substitution (s///) at /usr/bin/markdown line 246.
@sduckett
sduckett / code-reading.org
Created July 28, 2015 18:16
Thoughts on Code Reading

Thoughts on Code Reading

Goals

The goals of reading code, especially in a small library, include:

  • figuring out what the library does,
  • observing the structure of the library,

A Collection of Small Libraries

@sduckett
sduckett / as-we-may-think.org
Created July 28, 2015 18:00
Interesting parts of "As We May Think"

As We May Think

An essay by Vannevar Bush, from the July 1945 issue of The Atlantic

On automating an established idea

“The repetitive processes of thought are not confined however, to matters of arithmetic and statistics. In fact, every time one combines and records facts in accordance with established logical process, the creative aspect of thinking is concerned only with the selection of the data and the process to be employed and

@sduckett
sduckett / async-http.org
Last active August 29, 2015 14:25
Blocking requests vs asynchronous requests: what's the difference?

Asynchronous HTTP with core.async

What happens if we have a function like http/get in a go-block?

(defn fetch-target []
  (let [url (server-url :target)]
    (:body (http/get url))))