Skip to content

Instantly share code, notes, and snippets.

View nutjob4life's full-sized avatar
💭
Contemplating next hair color

Sean Kelly nutjob4life

💭
Contemplating next hair color
View GitHub Profile
@nutjob4life
nutjob4life / show-statements.py
Created February 18, 2022 18:25
Show the statements made by some RDF
# encoding: utf-8
#
# show-statements.py — print some RDF
#
# To use this:
#
# python3 -m venv venv
# venv/bin/pip install --quiet --upgrade pip setuptools rdflib
# venv/bin/python show-statements.py URL
@nutjob4life
nutjob4life / wagtail-for-beginners-review.md
Created January 24, 2022 16:10
Review: Wagtail for Beginners

(Context: I've just completed the Wagtail for Beginners course and have an opportunity to leave a review. However my review's 1600 characters-or-so and the review box is limited to 1000 characters. So I'm posting it here.)

TL;DR: good course but where's search? ★★★★☆

Overall this is a pretty nice and fairly deep introduction to Wagtail. I'm using this course while simultaneously setting up a major Wagtail site (with an estimated 10,000 objects), so I'm not just learning the basics but also getting a thorough immersion. What's good about this approach is that topics Taulien introduces here are directly applicable to my project, such as using wagtail.contrib.settings classes for my custom control panels, or dividing Django configuration between dev and production, or how drop-dead easy it is to add a sitemap.xml endpoint, and so forth. I've had trouble understanding StreamFields ("Why not just use RichTextField for everything?") but Taulien helps

@nutjob4life
nutjob4life / labcas_download.sh
Created October 26, 2021 22:59
LabCAS Bourne Shell download snippet
while IFS='' read -r LINE || [ -n "${LINE}" ]; do
echo "Downloading...: ${LINE}"
basename "$LINE"
f="$(basename -- $LINE)"
curl -H 'Authorization: Bearer xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' "${LINE}" > $f
done < files.csv
@nutjob4life
nutjob4life / labcas-download.py
Last active October 12, 2021 22:48
LabCAS Download Script
# encoding: utf-8
#
# Sample LabCAS Download script
#
# To run this, you'll need Python 3 with the `requests` package. The easiest
# way to do this is with a "virtual environment" by running:
#
# $ python3 -m venv venv
# $ cd venv
# $ bin/pip install --quiet --upgrade pip requests
@nutjob4life
nutjob4life / gist:a6dc847e090f2c9ee01b5a854b1c22c8
Created September 8, 2021 20:19
pds-api-service via Docker container
2021-09-08 20:16:43.422 ERROR 46 --- [ main] o.s.boot.SpringApplication : Application run failed
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'myBundlesApiController': Unsatisfied dependency expressed through field 'esRegistryConnection'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'esRegistryConnection' defined in class path resource [gov/nasa/pds/api/engineering/elasticsearch/ElasticSearchConfig.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [gov.nasa.pds.api.engineering.elasticsearch.ElasticSearchRegistryConnection]: Factory method 'ElasticSearchRegistryConnection' threw exception; nested exception is java.lang.RuntimeException: java.net.ConnectException: Connection refused
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredF
@nutjob4life
nutjob4life / gist:c1a2a84372e12b2321bccb06a9790a14
Created September 8, 2021 20:15
mvn spring-boot:run on NASA-PDS/registry-api-service
[INFO] --- spring-boot-maven-plugin:2.3.1.RELEASE:run (default-cli) @ registry-api-service ---
[INFO] Attaching agents: []
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/Users/kelly/.m2/repository/org/slf4j/slf4j-log4j12/1.7.30/slf4j-log4j12-1.7.30.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/Users/kelly/.m2/repository/ch/qos/logback/logback-classic/1.2.3/logback-classic-1.2.3.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
Exception in thread "main" java.lang.IllegalArgumentException: LoggerFactory is not a Logback LoggerContext but Logback is on the classpath. Either remove Logback or the competing implementation (class org.slf4j.impl.Log4jLoggerFactory loaded from file:/Users/kelly/.m2/repository/org/slf4j/slf4j-log4j12/1.7.30/slf4j-log4j12-1.7.30.jar). If you are using WebLogic you wil
@nutjob4life
nutjob4life / podcasts.md
Last active July 12, 2023 21:48
Sean Kelly's podcast recommendations

These are the podcasts I listen to and/or recommend, organized loosely by category. Updated 2021-06-05.

General Interest

  • 99% Invisible
  • Apple Events (video)
  • Decoder Ring
  • Endless Thread
  • Everything Everywhere Daily
@nutjob4life
nutjob4life / bmdb-query.sql
Created April 26, 2021 19:42
Maureen's Query
SELECT
biomarkers.id AS 'BM ID',
biomarker_names.name AS 'BM Name',
organs.name AS 'Organ',
organ_data.phase AS 'Organ phase',
studies.FHCRC_ID AS 'Protocol ID',
studies.title AS 'Protocol',
study_data.phase AS 'Protocol phase'
FROM
biomarker_names,
@nutjob4life
nutjob4life / practices.md
Last active March 10, 2021 19:52
Dockerfile Practices

These are some good practices I've seen going around and they've worked for me.

Images should be small

→ Choose a base image carefully: do you need a full ubuntu when debian will work fine? Or better yet, consider alpine, which is one of the smallest Linux bases out there.

→ Always clean up after yourself. If you did something like:

RUN apt-get install -y maven subversion && svn checkout http://old.repo/old/code/tags/1.0.0 tags && cd 1.0.0 && mvn install
@nutjob4life
nutjob4life / patch.diff
Created June 10, 2020 15:06
Quick and dirty profiling for Plone
--- /Users/kelly/.buildout/eggs/plone.recipe.zope2instance-4.4.1-py2.7.egg/plone/recipe/zope2instance/ctl.py 2020-06-10 10:04:50.000000000 -0500
+++ /tmp/ctl.py 2020-06-10 10:05:10.000000000 -0500
@@ -578,6 +578,7 @@
if debug or zopectl.WIN:
try:
+ command = ['/usr/local/opt/python@2/bin/python2.7', '-m', 'cProfile', '-o', '/tmp/stats', '/Users/kelly/Documents/Clients/JPL/Cancer/Portal/Development/P5/parts/zope-debug/bin/interpreter', '/Users/kelly/.buildout/eggs/Zope2-2.13.27-py2.7.egg/Zope2/Startup/run.py', '-C', '/Users/kelly/Documents/Clients/JPL/Cancer/Portal/Development/P5/parts/zope-debug/etc/zope.conf', '-X', 'debug-mode=on']
self._exitstatus = subprocess.call(command, env=env)
except KeyboardInterrupt:
return