Skip to content

Instantly share code, notes, and snippets.

SET startdir=%CD%
cd qupath
FOR /F "tokens=* USEBACKQ" %%F IN (`git rev-parse --short HEAD`) DO (
SET githash=%%F
)
ECHO %githash%
SET zipfile=qupath-%githash%-win.zip
ECHO %zipfile%
call gradlew.bat clean
call gradlew.bat jfxNative
@ECHO OFF
REM Get password expiration for currrent user and write to file
net user %USERNAME% /domain | findstr /C:"Password expires" > expires.txt
REM Assign variable from file contents
set /p EXPIRES=<expires.txt
REM Strip first 16 chars - "Password expires" - and leading spaces from string
for /f "tokens=* delims= " %%a in ("%EXPIRES:~16%") do set EXPIRES=%%a
REM Save trimmed password expiration date back to file
echo %EXPIRES% > expires.txt
@bdunnette
bdunnette / .env
Last active June 28, 2018 20:40
Save Aperio annotations to XML files
USERNAME="user"
PASSWORD="pass"
IMAGE_ENDPOINT="https://images.pathology.umn.edu/dataserver/Aperio.Images/Image"
SECURITY_ENDPOINT="https://images.pathology.umn.edu/dataserver/Aperio.Security/Security2"
XML_PATH='G:\My Drive\Projects\Metzger\AnnotationBackup'
PROJECT_ID=288
@bdunnette
bdunnette / nginxproxy.md
Created May 14, 2018 20:08 — forked from soheilhy/nginxproxy.md
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

import sys
import os
from zipfile import ZipFile
from csv import DictReader
from pathlib import Path
from datetime import date
from jinja2 import Template
bootstrap_version = "3.4.1"
jquery_version = "3.4.1"
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##*/}