Skip to content

Instantly share code, notes, and snippets.


Jared Folkins jaredfolkins

View GitHub Profile
jaredfolkins / WireGuard_Setup.txt
Created Feb 6, 2020 — forked from chrisswanda/WireGuard_Setup.txt
Stupid simple setting up WireGuard - Server and multiple peers
View WireGuard_Setup.txt
Install WireGuard via whatever package manager you use. For me, I use apt.
$ sudo add-apt-repository ppa:wireguard/wireguard
$ sudo apt-get update
$ sudo apt-get install wireguard
$ brew install wireguard-tools
Generate key your key pairs. The key pairs are just that, key pairs. They can be
View Javascript Max Array Size - OSX 10.11.6
// passes
total = 2147483647 * 2 + 1;
a = new Array(total);
console.log("total:" + total + " length:" + a.length);
// fails
total = 2147483647 * 2 + 2;
a = new Array(total);
console.log("total:" + total + " length:" + a.length);

Processing LiDAR to extract building heights

Walk through

Detailed walk through of building extraction using postgis

First lets pull a data layer from of openstreetmap. You can do this any which way you’d like, as there are a variety of methods for pulling openstreetmap data from their database. Check the [wiki] ( for a comprehensive list. My favourite method thus far is pulling the data straight into QGIS using the open layers plugin. For those who may want to explore this method, check [this tutorial] ( For building extraction you only need building footprints, and include the building tags. Not all polygons are of type building in OSM, so we can download all the polygons, and then filter the layer for only polygons tagged as buildings.

LiDAR data was pulled from USGS via the Earth Explorer site. [Here] (

jaredfolkins / gist:778d40cf52b0927c7c69
Last active Aug 29, 2015
Using gorename to refactor the gorethink rethinkdb driver.
View gist:778d40cf52b0927c7c69
gorename -from '"".Db' -to DB -v
gorename -from '"".DbCreate' -to DBCreate -v
gorename -from '"".DbDrop' -to DBDrop -v
gorename -from '"".RqlCompileError' -to ErrRQLCompile -v
gorename -from '"".RqlRuntimeError' -to ErrRQLRuntime -v
gorename -from '"".RqlClientError' -to ErrRQLClient -v
gorename -from '"".RqlDriverError' -to ErrRQLDriver -v
gorename -from '"".RqlConnectionError' -to ErrRQLConnection -v
View gist:19526b9d65209cc8b449
➜ h2demo git:(master) go run -race h2demo.go
2015/03/31 08:53:07 Listening on https://localhost:4430/
2015/03/31 08:53:11 Ignoring frame: [FrameHeader GOAWAY len=8]
Write by goroutine 15:
/usr/local/Cellar/go/1.4.2/libexec/src/bytes/buffer.go:62 +0x3b
/usr/local/Cellar/go/1.4.2/libexec/src/bytes/buffer.go:75 +0x3e
jaredfolkins / setup_test.go
Last active Aug 29, 2015
TestMain() Pattern
View setup_test.go
// Because TestMain() is an init method and should (in most cases) only be called once, one must wrap it to extend the functionality
// 1. This code should exist in a setup_test.go (descriptive name) file
// 2. Setup/Teardown methods along with variables/connections/assets for specific tests should be written inside of the specific test file
// Example Filename: some_random_test.go
// Setup Method: someRandomTestSetup()
// Teardown Method: someRandomTestTeardown()
// 3. The Setup/Teardown methods are added to the global testMainSetup()/testMainTeardown() to centralize and organize your test suite
package proj
View gist:9795523
func ShowCris(fname string, lname string) (string, error) {
res, err := DoSomethingAmazing(fname,lname)
if err != nil {
return res, nil
View gist:5060667
Traceback (most recent call last):
File "/home/elvis/emscripten/emcc", line 1272, in <module>
File "/home/elvis/emscripten/emcc", line 1222, in flush_js_optimizer_queue
final = shared.Building.js_optimizer(final, js_optimizer_queue, jcache)
File "/home/elvis/emscripten/tools/", line 1057, in js_optimizer
return, passes, NODE_JS, jcache)
File "/home/elvis/emscripten/tools/", line 179, in run
return temp_files.run_and_clean(lambda: run_on_js(filename, passes, js_engine, jcache))
File "/home/elvis/emscripten/tools/", line 435, in run_and_clean
jaredfolkins / robot.js
Created Dec 7, 2012 — forked from f6p/robot.js
View robot.js
// helpers
function areEnemies(robot, sighted) {
var sightedIsChild = ( == sighted.parentId);
var sightedIsParent = (robot.parentId ==;
return !(sightedIsChild || sightedIsParent);
function baseStep(robot) {
View gist:1093014
def save_deed_and_related_documents(deed)
unless deed.make_reference.nil?
deed.make_reference.each do | reference |
reference.each do | record |
puts record
You can’t perform that action at this time.