Skip to content

Instantly share code, notes, and snippets.

View mbjones's full-sized avatar

Matt Jones mbjones

View GitHub Profile
@prefix prov: <http://www.w3.org/ns/prov#> .
@prefix ns0: <http://www.openarchives.org/ore/terms/> .
@prefix dc: <http://purl.org/dc/terms/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix ns1: <http://purl.org/spar/cito/> .
@prefix dc11: <http://purl.org/dc/elements/1.1/> .
<https://cn-stage-2.test.dataone.org/cn/v2/resolve/urn%3Auuid%3A936436eb-2676-44b2-920c-acc5e28384f9>
prov:wasGeneratedBy <urn:uuid:aabccb0e-ccc8-4db8-a61d-53eb314906be> ;
a <http://purl.dataone.org/provone/2015/01/15/ontology#Data> ;
@mbjones
mbjones / generate
Created July 30, 2016 00:53 — forked from arfon/generate
Let's try and generate some codemeta files.
#!/usr/bin/ruby
# For an OO language, this is distinctly procedural. Should probably fix that.
require 'json'
details = Hash.new({})
capture_params = [
{ :name => "title", :message => "Enter project name." },
{ :name => "url", :message => "Enter the URL of the project repository." },
@mbjones
mbjones / example_iso_feature_catalog.xml
Created January 21, 2016 21:16
example_iso_feature_catalog
<?xml version="1.0" encoding="UTF-8"?>
<gfc:FC_FeatureCatalogue
id="_1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:gco="http://www.isotc211.org/2005/gco"
xmlns:gmd="http://www.isotc211.org/2005/gmd"
xmlns:gfc="http://www.isotc211.org/2005/gfc"
xmlns:gml="http://www.opengis.net/gml/3.2"
xmlns:gmx="http://www.isotc211.org/2005/gmx"
xsi:schemaLocation="http://www.isotc211.org/2005/gfc Q:\users\mize.jacqueline\ISO\gfc\gfc.xsd">
@mbjones
mbjones / example_filter_with_nse.R
Created October 20, 2015 04:04
demonstrate use of dplyr::filter with lapply, both with and without NSE
# Example R code to filter data using criteria passed in via lists, using lapply
# Matt Jones 2015-10-19
library(dplyr)
# create a sample fake data frame
df <- cbind(expand.grid(sciName=list("A", "B", "C", "D"), family=list("X", "Y"), stage=list("S1", "S2", "S3", "S4")), count=1)
df
# set up our filter conditions
condition1 <- list(sciName="A", stageVector=c("S2", "S3"))
@mbjones
mbjones / data_load_snippits.R
Created September 22, 2015 21:18
Demo to iterate across a directory and execute functions in R files in that directory.
#' Produces a merged foo dataset where the columns are merged from seperate data files.
#'
#' More detailed description here
#' @param datasetnums a list of the numeric datasets to be merged
#' @return the merged data frame
mergedata <- function(datasetnums) {
# Assume directory structure such as:
#data
# -- data1.R
@mbjones
mbjones / parse_adfg_harvest_data.R
Created August 31, 2015 23:55
ADFG HTML table parsing
library(XML)
library(httr)
post_url <- "http://www.adfg.alaska.gov/index.cfm?adfg=CommercialByFisherySalmon.exvesselquery"
post_body <- list(year="2014", areas= "allareas", speciesx= "allspecies", submit= "Find%20the%20Data")
html <- POST(post_url, body = post_body, encode = "form")
akcommdf_2014 <- readHTMLTable(content(html))[[1]]
#View(akcommdf_2014)
@mbjones
mbjones / keybase.md
Created December 16, 2014 21:50
Keybase Proof

Keybase proof

I hereby claim:

  • I am mbjones on github.
  • I am mbjones (https://keybase.io/mbjones) on keybase.
  • I have a public key whose fingerprint is AF42 17D9 18A4 4581 2B07 0682 6D3F 2BB3 48B5 8AF7

To claim this, I am signing this object: