Skip to content

Instantly share code, notes, and snippets.

View b5's full-sized avatar
💭
use of moved value

Brendan O'Brien b5

💭
use of moved value
View GitHub Profile
@b5
b5 / prefix-postfix.go
Created February 25, 2019 13:25
Top Down & Bottom Up Tree Traversal
package main
import "fmt"
// Node is a named element of a tree witha any number of children
type Node struct {
Name string
Children []Node
}
@b5
b5 / geo.py
Created January 22, 2019 16:38
Starlark Geospatial sample
# this is a Qri starlark transform script, use it with qri: https://qri.io
load("http.star", "http")
load("geo.star", "geo")
def download(ctx):
# Download list of 311 complaints, currently capped to 10000 responses for testing purposes
complaints = http.get("https://data.cityofnewyork.us/resource/fhrw-4uyv.json?$offset=0&$limit=10000")
# Download the New York Borough Boundaries
boros = http.get("http://data.beta.nyc//dataset/68c0332f-c3bb-4a78-a0c1-32af515892d6/resource/7c164faa-4458-4ff2-9ef0-09db00b509ef/download/42c737fd496f4d6683bba25fb0e86e1dnycboroughboundaries.geojson")
@b5
b5 / config.json
Created December 17, 2018 21:19
walk test config
{
"Badger": {
"Dir": "badger",
"ValueDir": "badger",
"SyncWrites": true,
"TableLoadingMode": 1,
"ValueLogLoadingMode": 2,
"NumVersionsToKeep": 1,
"MaxTableSize": 67108864,
"LevelSizeMultiplier": 10,
@b5
b5 / collection.json
Last active November 4, 2017 19:33 — forked from titaniumbones/collection.json
extract_href output from https://www.fws.gov/endangered/education/wonderful.html, "Wierd & Wonderful wildlife"
{
"name": "Wierd & Wonderful wildlife",
"url": "https://www.fws.gov/endangered/education/wonderful.html",
"description": "'There are many threatened and endangered species that you have probably never heard of. Here, you can learn about 14 weird and wonderful species that are currently endangered, threatened, or of special concern. Learning about these rare species can be fun! Choose a game and good luck!' Links mostly to old flash games. Not long for this world.'"
}
@b5
b5 / collection.json
Last active November 4, 2017 19:12 — forked from titaniumbones/collection.json
extract_href output from https://nccwsc.usgs.gov/acccnrs, "Advisory Committee on Climate Change and Natural Resource Science (ACCCNRS)"
{
"name": "Advisory Committee on Climate Change and Natural Resource Science (ACCCNRS)",
"url": "https://nccwsc.usgs.gov/acccnrs",
"description": "The Advisory Committee on Climate Change and Natural Resource Science (ACCCNRS) was established in 2013 to advise the Secretary of the Interior on the operations of the U.S. Geological Survey (USGS) National Climate Change and Wildlife Science Center (NCCWSC) and the Department of the Interior (DOI) Climate Science Centers (CSCs). ACCCNRS was composed of 25 members that represented (1) State and local governments, including state membership entities; (2) Nongovernmental organizations, including those whose primary mission is professional and scientific and those whose primary mission is conservation and related scientific and advocacy activities; (3) American Indian tribes and other Native American entities; (4) Academia; (5) Landowners, businesses, and organizations representing landowners or businesses. In 2015, ACCCNRS released its 2015 Report to the Secre

Keybase proof

I hereby claim:

  • I am b5 on github.
  • I am bfive (https://keybase.io/bfive) on keybase.
  • I have a public key ASAxwz2PapxPUS8GzFKzteRZ15MFoKkJjbxtjMP2Qw98tQo

To claim this, I am signing this object:

package main
import (
"bufio"
"flag"
"fmt"
"github.com/PuerkitoBio/purell"
"io"
"net/url"
"os"
@b5
b5 / collection.json
Created September 21, 2017 16:49
EPA Endangered Species Act Page
{ "name" : "Protecting Endangered Species from Pesticides",
"url" : "https://www.epa.gov/endangered-species",
"description" : "Main EPA Endangerewd Species Act & Pesticides Web Pages"
}
@b5
b5 / kiwix.go
Last active May 11, 2017 20:43
Scrape Kiwix Urls
// Scrape info from kiwix service. This takes a little while to execute.
package main
import (
"encoding/json"
"github.com/PuerkitoBio/goquery"
"io/ioutil"
"log"
"net/http"
"os"
@b5
b5 / audit_full.json
Created April 28, 2017 16:21
epa dataset audit
This file has been truncated, but you can view the full file.
{
"name": "EPA",
"descendants": 18476,
"descendantsDownloadedOnce": 6860,
"descendantsArchivedOnce": 6842,
"children": [
{
"name": "https",
"descendants": 15278,
"descendantsDownloadedOnce": 5865,