Skip to content

Instantly share code, notes, and snippets.

@foobarbecue
foobarbecue / uploadPapers.py
Created July 22, 2020 19:30
Example of uploading multiple papers to dataverse, using doi.org metadata
from pyDataverse.api import Api
from pyDataverse.exceptions import DatasetNotFoundError
from typing import List, Dict
import requests
import json
import pdfx
import re
from glob2 import glob
# NACpipeline Argo workflow
# Aaron Curtis
# Concurrency rules: Write files as temporary, then move to intended dest. Check for existing output before starting.
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: nac-stereo-
spec:
entrypoint: nac-mosaic
@foobarbecue
foobarbecue / aggregate-artifacts.yaml
Last active August 21, 2020 17:55
An example of using parameters to loop through artifact paths
apiVersion: v1
kind: ConfigMap
metadata:
name: workflow-controller-configmap
namespace: default
data:
artifactRepository: |
archiveLogs: true
s3:
bucket: my-bucket
@foobarbecue
foobarbecue / parcel-plugin-asset-fourohfour+0.1.13.patch
Last active August 7, 2019 06:26
patch to make parcel-plugin-asset-fourohfour work with recent versions of parcel
diff --git a/node_modules/parcel-plugin-asset-fourohfour/lib/CSS404Asset.js b/node_modules/parcel-plugin-asset-fourohfour/lib/CSS404Asset.js
index bad81f9..7028c39 100644
--- a/node_modules/parcel-plugin-asset-fourohfour/lib/CSS404Asset.js
+++ b/node_modules/parcel-plugin-asset-fourohfour/lib/CSS404Asset.js
@@ -3,7 +3,7 @@
const debug = require('debug')('parcel-plugin-asset-fourohfour');
const fs = require('fs');
const CSSAsset = require('parcel-bundler/lib/assets/CSSAsset');
-const logger = require('parcel-bundler/lib/Logger');
+const logger = require("@parcel/logger");
@foobarbecue
foobarbecue / index.html
Last active June 15, 2016 18:07
Minimal case: Calling .select() changes bound data
<html>
<body>
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.17/d3.js">
</script>
<script>
// Setup
let body = d3.selectAll('body')
let exampleData =
[
{_id:"groupOne", items:['one','two']},
Template.notebookIndex.onRendered(function() {
var self = this;
self.autorun(function () {
self.subscribe('publicPosts', Session.get('current_tag'), function () {
console.log($('.post-meta'));
// Unfortunate hack to align the post meta info
//setTimeout(function(){
self.$('.post-meta').each(function () {
$(this).css('transform', 'rotate(270deg) translate(-' + $(this).width() + 'px, -1.5em)')
})
@foobarbecue
foobarbecue / perrenialSnow.py
Created May 12, 2015 00:09
A script to calculate areas of perennial snow from MOD10A2 data
import os, subprocess, glob, numpy
from datetime import datetime
import gdal_calculations as gdalcalc
def hdf_dir_to_tif(input_dir):
acquisition_date = input_dir[-11:-1]
print 'Converting HDFs to TIFs'
for hdf_filepath in glob.glob(input_dir+'*.hdf'):
tif_filepath = hdf_filepath +'.tif'
subprocess.call(
@foobarbecue
foobarbecue / loganalyzerscoping.ipynb
Created June 27, 2014 19:43
LogAnalyzer scoping problem
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@foobarbecue
foobarbecue / gist:6443825
Last active December 22, 2015 08:18
Demonstration of pandas short first row bug
{
"metadata": {
"name": "pandas short first row"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{