Skip to content

Instantly share code, notes, and snippets.

View jaredfolkins's full-sized avatar
🧂
💡

Jared Folkins jaredfolkins

🧂
💡
View GitHub Profile
@chrisswanda
chrisswanda / WireGuard_Setup.txt
Last active May 2, 2024 01:13
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
@jonhoo
jonhoo / README.md
Last active July 19, 2021 10:49
Distributed RWMutex in Go
@YKCzoli
YKCzoli / Lidar_walkthrough.md
Last active November 15, 2023 18:35
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

package main
import (
"net/http"
"database/sql"
"fmt"
"log"
"os"
)
@sadache
sadache / gist:4714280
Last active July 14, 2022 15:09
Playframework: Async, Reactive, Threads, Futures, ExecutionContexts

Asynchronicity is the price to pay, you better know what you're paying for...

Let's share some vocabulary first:

Thread: The primitive responsible of executing code on the processor, you can give an existing (or a new) Thread some code, and it will execute it. Normally you can have a few hundreds on a JVM, arguments that you can tweak your way out to thousands. Worth noting that multitasking is achieved when using multiple Threads. Multiple Threads can exist for a single processor in which case multitasking happens when this processor switches between threads, called context switching, which will give the impression of things happenning in parallel. An example of a direct, and probably naive, use of a new Thread in Java:

public class MyRunnable implements Runnable {
  public void run(){
 System.out.println("MyRunnable running");
@xamox
xamox / balltrack.py
Created April 21, 2012 18:05
Object Tracking with SimpleCV (White Ball)
'''
This is how to track a white ball example using SimpleCV
The parameters may need to be adjusted to match the RGB color
of your object.
The demo video can be found at:
http://www.youtube.com/watch?v=jihxqg3kr-g
'''
print __doc__
@kylelemons
kylelemons / regexpswitch.go
Created August 18, 2011 16:34
Switch on a regex pattern
package main
import "fmt"
import "regexp"
var email = regexp.MustCompile(`^[^@]+@[^@.]+\.[^@.]+$`)
var shortPhone = regexp.MustCompile(`^[0-9][0-9][0-9][.\-]?[0-9][0-9][0-9][0-9]$`)
var longPhone = regexp.MustCompile(`^[(]?[0-9][0-9][0-9][). \-]*[0-9][0-9][0-9][.\-]?[0-9][0-9][0-9][0-9]$`)
func main() {