Skip to content

Instantly share code, notes, and snippets.

View jwestgard's full-sized avatar

Joshua Westgard jwestgard

  • College Park
  • 08:15 (UTC -04:00)
View GitHub Profile
@jwestgard
jwestgard / dspace_export.sh
Last active February 14, 2024 16:25
Export and download objects from Dspace running in k8s
#!/bin/zsh
DIR='output'
for HANDLE in $@; do
ID=${HANDLE#http://hdl.handle.net/1903/*}
DEST="$DIR/$ID"
EXPORT_CMD="/dspace/bin/dspace export -t ITEM -i 1903/$ID -d /dspace/upload -n $ID"
DELETE_CMD="rm -rf /dspace/upload/$ID"
if [ -d $DEST ]; then
% npm test -- --runInBand
> DART@2.0.9 test /Users/westgard/Dev/dart
> jest "--runInBand"
FAIL plugins/network/sftp_client.test.js (7.376 s)
● Console
console.log
[
@jwestgard
jwestgard / energy.py
Last active October 12, 2019 13:05
state class example
import csv
class State():
def __init__(self, row):
self.abbrev = row["State"]
self.mwh = row["Megawathours"]
self.source = row["Energy Source"]
self.year = row["Year"]
def main():
@jwestgard
jwestgard / "Weekday" class example
Last active October 7, 2019 15:54
An example of a simple class that initializes a "day" with a method to provide a greeting appropriate to the day
class Weekday():
def __init__(self, code):
if code == 'mo':
self.weekday = 'Monday'
elif code == 'tu':
self.weekday = 'Tuesday'
elif code == 'we':
self.weekday = 'Wednesday'
elif code == 'th':
self.weekday = 'Thursday'
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix pcdm: <http://pcdm.org/models#> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix acl: <http://www.w3.org/ns/auth/acl#> .
@prefix pcdmfmt: <http://pcdm.org/file-format-types#> .
@prefix pcdmuse: <http://pcdm.org/use#> .
@prefix xml: <http://www.w3.org/XML/1998/namespace> .
@prefix rel: <http://id.loc.gov/vocabulary/relators/> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix fedoraconfig: <http://fedora.info/definitions/v4/config#> .
@jwestgard
jwestgard / python_rdflib_REPL
Last active May 24, 2017 01:46
Brief instructions on parsing RDF with Python rdflib in the interactive prompt
# launch the interactive prompt
python3
# import the module
import rdflib
# create an empty graph object
g = rdflib.Graph()
# parse a turtle file
<!DOCTYPE html>
<meta charset="utf-8">
<link rel="stylesheet" href="http://cmx.io/v/0.1/cmx.css"/>
<script src="http://cmx.io/v/0.1/cmx.js"></script>
<body>
<scene id="scene1">
<label t="translate(0,346)">
<tspan x="0" y="0em">One day at Big Research U ...</tspan>
@jwestgard
jwestgard / index.html
Last active August 29, 2015 13:57
A cmx.io comic
<!DOCTYPE html>
<meta charset="utf-8">
<link rel="stylesheet" href="http://cmx.io/v/0.1/cmx.css"/>
<script src="http://cmx.io/v/0.1/cmx.js"></script>
<body>
<scene id="scene1">
<label t="translate(0,346)">
<tspan x="0" y="0em">One day on the internet...</tspan>
<!DOCTYPE html>
<meta charset="utf-8">
<link rel="stylesheet" href="http://cmx.io/v/0.1/cmx.css">
<script src="http://cmx.io/v/0.1/cmx.js" charset="utf-8"></script>
<style>.cmx-user-scene4 .cmx-text-border .cmx-path {stroke: orange}</style>
<body>
<div style="max-width:900px; -webkit-transform:rotate(0deg)">
<scene id="scene1">