Skip to content

Instantly share code, notes, and snippets.

View jaredfolkins's full-sized avatar
🧂
💡

Jared Folkins jaredfolkins

🧂
💡
View GitHub Profile
@jaredfolkins
jaredfolkins / WireGuard_Setup.txt
Created February 6, 2020 01:05 — forked from chrisswanda/WireGuard_Setup.txt
Stupid simple setting up WireGuard - Server and multiple peers
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
MacOS
$ brew install wireguard-tools
Generate key your key pairs. The key pairs are just that, key pairs. They can be
// 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);
@jaredfolkins
jaredfolkins / Lidar_walkthrough.md
Created September 25, 2015 00:03 — forked from YKCzoli/Lidar_walkthrough.md
Lidar_walkthrough

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] (http://wiki.openstreetmap.org/wiki/Downloading_data) 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] (http://www.qgistutorials.com/en/docs/downloading_osm_data.html). 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] (http://earthobservatory.nasa.gov/blogs/ele

@jaredfolkins
jaredfolkins / gist:778d40cf52b0927c7c69
Last active August 29, 2015 14:19
Using gorename to refactor the gorethink rethinkdb driver.
gorename -from '"github.com/dancannon/gorethink".Db' -to DB -v
gorename -from '"github.com/dancannon/gorethink".DbCreate' -to DBCreate -v
gorename -from '"github.com/dancannon/gorethink".DbDrop' -to DBDrop -v
gorename -from '"github.com/dancannon/gorethink".RqlCompileError' -to ErrRQLCompile -v
gorename -from '"github.com/dancannon/gorethink".RqlRuntimeError' -to ErrRQLRuntime -v
gorename -from '"github.com/dancannon/gorethink".RqlClientError' -to ErrRQLClient -v
gorename -from '"github.com/dancannon/gorethink".RqlDriverError' -to ErrRQLDriver -v
gorename -from '"github.com/dancannon/gorethink".RqlConnectionError' -to ErrRQLConnection -v
➜ 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]
==================
WARNING: DATA RACE
Write by goroutine 15:
bytes.(*Buffer).Truncate()
/usr/local/Cellar/go/1.4.2/libexec/src/bytes/buffer.go:62 +0x3b
bytes.(*Buffer).Reset()
/usr/local/Cellar/go/1.4.2/libexec/src/bytes/buffer.go:75 +0x3e
@jaredfolkins
jaredfolkins / setup_test.go
Last active August 29, 2015 14:16
TestMain() Pattern
// 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
func ShowCris(fname string, lname string) (string, error) {
res, err := DoSomethingAmazing(fname,lname)
if err != nil {
Panic(err)
}
return res, nil
}
Traceback (most recent call last):
File "/home/elvis/emscripten/emcc", line 1272, in <module>
flush_js_optimizer_queue()
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/shared.py", line 1057, in js_optimizer
return js_optimizer.run(filename, passes, NODE_JS, jcache)
File "/home/elvis/emscripten/tools/js_optimizer.py", line 179, in run
return temp_files.run_and_clean(lambda: run_on_js(filename, passes, js_engine, jcache))
File "/home/elvis/emscripten/tools/shared.py", line 435, in run_and_clean
@jaredfolkins
jaredfolkins / robot.js
Created December 7, 2012 00:00 — forked from f6p/robot.js
NecroBadger
// helpers
function areEnemies(robot, sighted) {
var sightedIsChild = (robot.id == sighted.parentId);
var sightedIsParent = (robot.parentId == sighted.id);
return !(sightedIsChild || sightedIsParent);
};
function baseStep(robot) {
def save_deed_and_related_documents(deed)
unless deed.make_reference.nil?
deed.make_reference.each do | reference |
reference.each do | record |
puts record
end
end
end
end