Skip to content

Instantly share code, notes, and snippets.

View bdunnette's full-sized avatar
💭
🤔

Brian Dunnette bdunnette

💭
🤔
View GitHub Profile
import sys
import os
import json
from csv import DictReader
files_to_parse = sys.argv[1:]
for f in files_to_parse:
print("Reading cases from %s" % f)
json_filename = "%s.json" % os.path.splitext(f)[0]
cases = []
#!/bin/bash
#Read case/slide titles from titles.txt (one case/title per line)
titles=()
while read line
do
# echo $line
titles+=("$line")
done < titles.txt
# echo ${titles[@]}
-- Find files from specific data group
SELECT [ImageId],[CompressedFileLocation]
FROM [Aperio].[dbo].[Image]
WHERE [DataGroupID]=162
-- Update file location of given image
UPDATE [Aperio].[dbo].[Image]
SET [CompressedFileLocation]='\\gleason\images2\Projects\Giubellino\D17-1452-CompoundSpitzNevus.svs'
WHERE [ImageId]=76585
for %%f in (*.svs) do (
echo %%~nf
vips openslideload --associated thumbnail "%%~nf.svs" "%%~nf.jpg"
vipsthumbnail -s 256 "%%~nf.jpg"
del "%%~nf.jpg"
)
#!/bin/bash
# This script requires libvips-tools to be installed
trackingcode="UA-39453866-3"
imagehost="web-basic.oit.umn.edu"
tracking_script="<script>(function(e,t,n,r,i,s,o){e[\"GoogleAnalyticsObject\"]=i;e[i]=e[i]||function(){(e[i].q=e[i].q||[]).push(arguments)},e[i].l=1*new Date;s=t.createElement(n),o=t.getElementsByTagName(n)[0];s.async=1;s.src=r;o.parentNode.insertBefore(s,o)})(window,document,\"script\",\"//www.google-analytics.com/analytics.js\",\"ga\");ga(\"create\",\"$trackingcode\",\"umn.edu\");ga(\"send\",\"pageview\")</script>"
indextitle=${PWD##*/}
SELECT TOP 100 *
FROM [Aperio].[dbo].[Specimen] Specimen
INNER JOIN [Aperio].[dbo].[Slide] Slide
ON Slide.ParentId=Specimen.Id
INNER JOIN [Aperio].[dbo].[Image] Image
ON Image.ParentId=Slide.Id
WHERE Specimen.ColumnPublishToWeb2 = 'TRUE'
@bdunnette
bdunnette / Dockerfile
Created April 28, 2017 19:48
Dockerfile for Ubuntu 16.04 LTS & libvips-tools
FROM ubuntu:16.04
MAINTAINER Brian Dunnette <[email protected]>
RUN \
# Install dependencies
sed "s/archive.ubuntu.com/local-mirror.cs.umn.edu/g; \
s/security.ubuntu.com/local-mirror.cs.umn.edu/g" \
-i /etc/apt/sources.list && \
apt-get update && \
# cd to your Loopback project directory and run:
# curl https://gist.githubusercontent.com/bdunnette/a1854b4f0c5010cb7a539be5f2d63ef8/raw/add-gulp.sh | sh
REPO=https://gist.githubusercontent.com/bdunnette/a1854b4f0c5010cb7a539be5f2d63ef8/raw
echo client/vendor >> .gitignore
mv server/boot/root.js server/boot/root.js.bak
sed 's/\("files\".*\:.*{\)/&\"loopback\#static\"\:\{\"params\"\:\"\$\!\.\.\/client\"\}/' -i server/middleware.json
sed 's/\("compression\".*\:.*{\)/&\"enabled\":false/' -i server/middleware.json
mkdir -p client/js client/css server/fixtures
touch client/css/app.css server/fixtures/.gitkeep
wget -O gulpfile.js $REPO/gulpfile.js
@bdunnette
bdunnette / install-watchman.sh
Last active November 28, 2017 10:49 — forked from ivan-loh/install-watchman.sh
Watchman installation for Ubuntu 16.04
# checkout, compile & install
git clone https://github.com/facebook/watchman.git
cd watchman/
# git checkout v4.7.0
sudo apt install -y autoconf automake build-essential python-dev
./autogen.sh
./configure
make
sudo make install
echo "Using $1 for output..."
for s in *.pdf
do
i="${s%.*}"
printf "# $i\n\n" >> $1
echo $s
pdftotext $s - >> $1
done