This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import postgres from 'postgres' | |
import { pipeline } from 'node:stream/promises' | |
import { Readable } from 'node:stream' | |
// Enter your local values | |
const connectUrl = 'postgres://user:password@host/db' | |
const sql = await postgres(connectUrl, { debug: true }) | |
async function importData (tableName, data) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
xmldebug=0 | |
USAGE="Usage: $0 plateid1 [plateid2 ...] | |
(plateids can also be a range xxx-yyy)" | |
if [ "$#" == "0" ]; then | |
echo "$USAGE" | |
exit 1 | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// a is a jquery collection | |
// fn is a function that returns a promise | |
function loadItems(a, fn) { | |
var d = $.Deferred(); | |
var next = d.promise(); | |
a.each(function () { | |
var that = this; | |
next = next.pipe(function () { |