Skip to content

Instantly share code, notes, and snippets.

View bdunnette's full-sized avatar
💭
🤔

Brian Dunnette bdunnette

💭
🤔
View GitHub Profile
#!/bin/sh
sed -i "/^AWS_ACCESS_KEY_ID*/d" ${PWD##*/}/settings.py
sed -i "/^AWS_SECRET_ACCESS_KEY/d" ${PWD##*/}/settings.py
'''Example script to generate text from Nietzsche's writings.
At least 20 epochs are required before the generated text
starts sounding coherent.
It is recommended to run this script on GPU, as recurrent
networks are quite computationally intensive.
If you try this script on new data, make sure your corpus
has at least ~100k characters. ~1M is better.
sqlcmd -S . -d Aperio -E -s, -W -Q "SET NOCOUNT ON; SELECT * FROM [Core].[Stain] WITH (NOLOCK)" > S:\Images\stains.csv
sqlcmd -S . -d Aperio -E -s, -W -Q "SET NOCOUNT ON; SELECT * FROM [Core].[DataGroup] WITH (NOLOCK)" > S:\Images\datagroups.csv
sqlcmd -S . -d Aperio -E -s, -W -Q "SET NOCOUNT ON; SELECT * FROM [dbo].[Case] WITH (NOLOCK)" > S:\Images\cases.csv
sqlcmd -S . -d Aperio -E -s, -W -Q "SET NOCOUNT ON; SELECT * FROM [dbo].[Project] WITH (NOLOCK)" > S:\Images\projects.csv
sqlcmd -S . -d Aperio -E -s, -W -Q "SET NOCOUNT ON; SELECT * FROM [dbo].[BodySite] WITH (NOLOCK)" > S:\Images\bodysites.csv
sqlcmd -S . -d Aperio -E -s, -W -Q "SET NOCOUNT ON; SELECT * FROM [dbo].[Specimen] WITH (NOLOCK)" > S:\Images\specimens.csv
sqlcmd -S . -d Aperio -E -s, -W -Q "SET NOCOUNT ON; SELECT * FROM [dbo].[Slide] WITH (NOLOCK)" > S:\Images\slides.csv
sqlcmd -S . -d Aperio -E -s, -W -Q "SET NOCOUNT ON; SELECT * FROM [dbo].[Image] WITH (NOLOCK)" > S:\Images\images.csv
USE Aperio
SELECT *
FROM [dbo].[Image]
JOIN [dbo].[Slide] ON Slide.Id=Image.ParentId
LEFT JOIN [dbo].[Specimen] ON Slide.ParentId=Specimen.Id
LEFT JOIN [dbo].[Case] AS CaseStudy ON Specimen.ParentId=CaseStudy.Id
LEFT JOIN [Core].[Stain] ON Slide.StainId=Stain.Id
LEFT JOIN [dbo].[BodySite] ON Slide.BodySiteId=BodySite.Id
WHERE Specimen.DataGroupId = 62
AND Image.CompressedFileLocation != ''
AWS_ACCESS_KEY_ID='id'
AWS_SECRET_ACCESS_KEY='key'
AWS_STORAGE_BUCKET_NAME='zappa-12345678'
AWS_WEBHOST='98765432.execute-api.us-east-1.amazonaws.com'
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"