Skip to content

Instantly share code, notes, and snippets.

View loganpowell's full-sized avatar

Logan Powell loganpowell

  • Metro DC
View GitHub Profile
@loganpowell
loganpowell / aws-couchdb-setup.md
Created August 18, 2019 09:50 — forked from Ravenstine/aws-couchdb-setup.md
Fast CouchDB setup in AWS

Fast CouchDB setup in AWS

CouchDB is a NoSQL database for storing JSON documents. It comes with a REST API out of the box so your client applications can persist data while requiring you to write little or no server-side code. CouchDB's killer feature is its ability to easily replicate, which allows for horizontal scaling, easy backup, and for client adapters to synchronize documents. This is perfect if you want to write an application that is offline-first. It's become my go-to database when creating new

@loganpowell
loganpowell / city-sdk_tutotrials.md
Created April 18, 2019 13:16
CitySDK tutorials

CitySDK v2.0 (Beta) Tutorials

I. Orientation

The CitySDK is a JavaScript library, which combines and abstracts three underlying APIs into a single function. As little as possible was "created" to facilitate the simplest abstraction possible. However, some trade-offs where made in v2 to enable the greatest flexibility of the abstraction, without creating an unsustainable maintanance burden for the library custodians.

The biggest of these trade-offs we've made is that we are not aliasing Census variables here. It is the burden of the user to choose the correct variable for each vintage they seek (as the same variable ID can mean different things between vintages). The primary reason for this choice is that the underlying API is still in flux and we don't want to be blamed for any mis-assigned aliases.

That having been said, here we will give you the fastest path for discovering your variables of interest.

@loganpowell
loganpowell / readme.md
Created January 31, 2019 22:35 — forked from jonlidgard/readme.md
PRU's on the Beaglebone Black

PRU’s on the Beaglebone - ( Using UIO with the TI Kernel )

This guide is written for fellow newbies to the BBB as an aid to understanding how to talk to the onboard PRU's. As a newbie some of my terminology and understanding may not be quite correct, however it's hopefully enough to give you an idea what is going on. The whole subject is a bit of a minefield for the beginner; a lot of things have changed over the last few years and most of the guides you come across are only partially correct, you have to pick through the bones to find the nuggets!. If you're using a modern stock debian image then blindly following them will lead to nothing but frustration. This guide will surely become irrelevant with time too but hopefully as of Oct 2017 it will be of some use.

My system

I'm using the stock debian 9.1 IOT image from Beagleboard.org on an old 2GB Beaglebone Black.

rproc & uio, Kernel images, dtb's, uboot overlays, omg wtf?

In the beginning there was the Linux Userspace I/O interface (UIO) for commu

@loganpowell
loganpowell / combining-git-repositories.md
Created December 17, 2018 14:48 — forked from msrose/combining-git-repositories.md
How to combine two git repositories.

Combining two git repositories

Use case: You have repository A with remote location rA, and repository B (which may or may not have remote location rB). You want to do one of two things:

  • preserve all commits of both repositories, but replace everything from A with the contents of B, and use rA as your remote location
  • actually combine the two repositories, as if they are two branches that you want to merge, using rA as the remote location

NB: Check out git subtree/git submodule and this Stack Overflow question before going through the steps below. This gist is just a record of how I solved this problem on my own one day.

Before starting, make sure your local and remote repositories are up-to-date with all changes you need. The following steps use the general idea of changing the remote origin and renaming the local master branch of one of the repos in order to combine the two master branches.

@loganpowell
loganpowell / inlineworker.js
Created November 20, 2018 12:27 — forked from SunboX/inlineworker.js
Create web workers without a separate worker JS files. Source: http://jsbin.com/owogib/8/
function worker() {
setInterval(function() {
postMessage({foo: "bar"});
}, 1000);
}
var code = worker.toString();
code = code.substring(code.indexOf("{")+1, code.lastIndexOf("}"));
var blob = new Blob([code], {type: "application/javascript"});
@loganpowell
loganpowell / require-in-webworker.js
Last active May 7, 2023 19:55
Using RequireJS in Web Worker
// See documentation: https://requirejs.org/docs/api.html#webworker
// working example: https://jsfiddle.net/yojaar80/2/
// from SO: https://stackoverflow.com/questions/36840329/whats-the-right-way-to-use-require-js-with-web-workers
importScripts("require.js");
requirejs.config({
//Lib path
baseUrl: '.',
@loganpowell
loganpowell / datascripts.cljs
Last active October 30, 2018 19:00
TODOs: transducer work for DataScript :db creation
; 1) For transducer: https://github.com/loganpowell/census-geojson/issues/12
(def test-array [["for" "geo1"]
["in" "geo2"]
["in" "geo3"]
["DATE" "6"]])
(let [rearranged (conj (vec (rest test-array))
(vec (first test-array)))]
;;=> [["in" "geo2"] ["in" "geo3"] ["DATE" "6"] ["for" "geo1"]]
@loganpowell
loganpowell / census.md
Last active October 23, 2018 19:00
Documentation `census`

CitySDK v2.0 (Beta)

The census Function

CitySDK v2.0 ships the census function, which takes two arguments:

  • The first is an argument object with a set of key/value pairs parameters (See "Full Parameter Set" below)
  • The second is a callback function, which will be called upon completion of the census function and applied to the response

Full Parameter Set

(ns react-components.core
(:require [reagent.core :as reagent :refer [atom]]))
(enable-console-print!)
(defonce app-state
(atom {:text "Hello world!"
:plain {:comment "and I can take props from the atom"}}))
(defn comment-box []
@loganpowell
loganpowell / tiger.clj
Last active October 16, 2018 12:00
TigerWeb Archeology
(ns geojson.index)
;; / 888 / e e
;; e88~88e e88~~8e e88~-_ 888 / e88~~8e Y88b / d8b d8b /~~~8e 888-~88e
;; 888 888 d888 88b d888 i 888/\ d888 88b Y888/ d888bdY88b 88b 888 888b
;; "88_88" 8888__888 8888 | 888 \ 8888__888 Y8/ / Y88Y Y888b e88~-888 888 8888
;; / Y888 , Y888 ' 888 \ Y888 , Y / YY Y888b C888 888 888 888P
;; Cb "88___/ "88_-~ 888 \ "88___/ / / Y888b "88_-888 888-_88"
;; Y8"'8D _/ 888