View setup.cfg
# https://gist.github.com/althonos/6914b896789d3f2078d1e6237642c35c | |
[metadata] | |
name = {name} | |
version = file: {name}/_version.txt | |
author = Martin Larralde | |
author-email = martin.larralde@embl.de | |
home-page = https://github.com/althonos/{name} | |
description = {description} | |
long-description = file: README.md |
View plum.json
{ | |
"states": ["pending", "metadata_review", "final_review", "complete", "flagged", "takedown"], | |
"state_groups":[ | |
{"name":"suppressed", "states":["pending", "metadata_review", "final_review", "takedown"]} | |
], | |
"events":[ | |
{ "from":"pending", "to":"metadata_review", "name":"finalize_digitization" }, | |
{ "from":"metadata_review", "to":"final_review", "name":"finalize_metadata" }, | |
{ "from":"final_review", "to":"complete", "name":"complete" }, | |
{ "from":"complete", "to":"takedown", "name":"takedown" }, |
View vocabs.rb
# The ruby-rdf vocabulary loader is used to maintain the vocabularies in the core library. | |
# There's a rake task that is the main way it is used and serves as a good reference. | |
# https://github.com/ruby-rdf/rdf/blob/develop/Rakefile | |
rake gen_vocabs | |
# Generate lib/rdf/vocab/cc.rb | |
# Generate lib/rdf/vocab/cert.rb | |
# Generate lib/rdf/vocab/dc.rb | |
# Generate lib/rdf/vocab/dc11.rb |
View oregon_rdf_demo.rb
# RdfResource is a subclass of RDF::Graph with property configuration, accessors, and some other methods | |
# for managing "resources" as discrete subgraphs which can be managed by a Hydra datastream model. | |
# | |
# The relevant modules and class are: | |
# | |
# https://github.com/OregonDigital/oregondigital/tree/master/lib/oregon_digital/rdf/rdf_configurable.rb | |
# https://github.com/OregonDigital/oregondigital/tree/master/lib/oregon_digital/rdf/rdf_properties.rb | |
# https://github.com/OregonDigital/oregondigital/tree/master/lib/oregon_digital/rdf/rdf_resource.rb | |
bnode = OregonDigital::RDF::RdfResource.new |
View benchmark.sh
#!/bin/bash | |
# REQUIRES SUDO | |
# Benchmark runner | |
repeats=20 | |
output_file='benchmark_results.csv' | |
command_to_run='echo 1' | |
run_tests() { | |
# -------------------------------------------------------------------------- |
View parse-options.sh
#!/bin/bash | |
# | |
# Example of how to parse short/long options with 'getopt' | |
# | |
OPTS=`getopt -o vhns: --long verbose,dry-run,help,stack-size: -n 'parse-options' -- "$@"` | |
if [ $? != 0 ] ; then echo "Failed parsing options." >&2 ; exit 1 ; fi | |
echo "$OPTS" |
View rvm_apache_passenger.txt
# Install rvm system-wide | |
bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer ) | |
# Update the packages | |
apt-get update | |
apt-get upgrade | |
apt-get install build-essential | |
# get the packages required by ruby | |
rvm pkg install zlib |
View bots.py
#!/usr/bin/env python | |
""" | |
Hack to look for user agent strings in typical Apache style log and | |
count up the number of requests by bots vs non-bots. The list of bot | |
user agents comes from http://www.user-agents.org/ but has had some | |
agents added to it, since the user-agents.org list is pretty out of date, e.g. | |
no Bing?! | |
""" |
View capybara cheat sheet
=Navigating= | |
visit('/projects') | |
visit(post_comments_path(post)) | |
=Clicking links and buttons= | |
click_link('id-of-link') | |
click_link('Link Text') | |
click_button('Save') | |
click('Link Text') # Click either a link or a button | |
click('Button Value') |
View link_header.py
#!/usr/bin/env python | |
""" | |
HTTP Link Header Parsing | |
Simple routines to parse and manipulate Link headers. | |
""" | |
__license__ = """ | |
Copyright (c) 2009 Mark Nottingham |
NewerOlder