Skip to content

Instantly share code, notes, and snippets.

@DanaCase
DanaCase / points_to_patches.groovy
Created February 27, 2018 19:17
Convert a list of patch coordinates to qupath annotations
import qupath.lib.scripting.QP
import qupath.lib.roi.RectangleROI
import qupath.lib.objects.PathAnnotationObject
points_list = [[0,0]]
def hierarchy = QP.getCurrentHierarchy()
points_list.each {
@DanaCase
DanaCase / .vimrc
Last active August 13, 2018 21:52
.vimrc
"for allowing vundles
set nocompatible
filetype plugin indent on
syntax on
set backspace=2
set clipboard=unnamed
set t_Co=256
set background=dark
let g:solarized_temrcolors=256
# grabbed reported MB from a log file
perl -nE'/((\d+)\ MB)$/&&say$2'
'From https://mislav.net/2014/02/hidden-documentation/
'See who has been working on stuff in the last 6 months
git log --format='%an' --since='6 months ago' . | sort | uniq -c | sort -rn | head
'Get the last two tags
git describe --tags $(git rev-list --tags --max-count=2)
'Log commit messages from 0.23.0 to 0.23.2
@DanaCase
DanaCase / init.vim
Created July 31, 2020 01:44
nvim init file
"for allowing vundles
"set nocompatible
"filetype plugin indent on
"filetype plugin on
"syntax on
set backspace=2
if system('uname -s') == "Darwin\n"
set clipboard=unnamed "OSX
else
@DanaCase
DanaCase / gist:e35bfda97f81566c556fcd12dbe0edcf
Created August 4, 2021 21:17
Some google sheets queries
Parado from jira components
=query(Jira!A:ZZ,"Select Y,count(Y) where Y is not null and V > date '2021-07-15' group by Y order by count(Y) desc label count(Y) 'Count'",1)
Parado from field defects log filtered by pp2
=query(Sheet1!A661:H,"Select H,count(H) where H is not null and C = 'PP2' group by H order by count(H) desc label count(H) 'Count'",1)
@DanaCase
DanaCase / Paste_to_TeamViewer.scpt
Created December 1, 2021 17:34
This is a quick gist to paste into TeamViewer when the clipboard isn't shared (for example on the log in screen). From https://gist.github.com/ethack/110f7f46272447828352768e6cd1c4cb
tell application "TeamViewer" to activate
tell application "System Events"
keystroke (the clipboard as text)
end tell
@DanaCase
DanaCase / AperioToQuPath.groovy
Last active May 6, 2023 09:05
Convert Exported Aperio Image Scope Annotations to QuPath Annotations
import qupath.lib.scripting.QP
import qupath.lib.geom.Point2
import qupath.lib.roi.PolygonROI
import qupath.lib.objects.PathAnnotationObject
import qupath.lib.images.servers.ImageServer
//Aperio Image Scope displays images in a different orientation
def rotated = true
@DanaCase
DanaCase / helpful.txt
Created July 1, 2023 02:14
Helpful vim commands
# Wrap all columns in a csv with quotes
%s/\([^,]*\)\(,\|$\)/"\1"\2/g
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="210mm"
height="297mm"
viewBox="0 0 210 297"
version="1.1"
id="svg1"
inkscape:version="1.3 (0e150ed, 2023-07-21)"