Skip to content

Instantly share code, notes, and snippets.

@zachmullen
zachmullen / gist:eecf4bc673772cac64e2c7cf03baa367
Created February 5, 2019 21:22
girder_client disable SSL verify
gc = girder_client.GirderClient()
with gc.session() as session:
session.verify = False
gc.authenticate(...)
gc.post(...)
@bsweger
bsweger / useful_pandas_snippets.md
Last active April 19, 2024 18:04
Useful Pandas Snippets

Useful Pandas Snippets

A personal diary of DataFrame munging over the years.

Data Types and Conversion

Convert Series datatype to numeric (will error if column has non-numeric values)
(h/t @makmanalp)

@Chaser324
Chaser324 / GitHub-Forking.md
Last active May 2, 2024 05:49
GitHub Standard Fork & Pull Request Workflow

Whether you're trying to give back to the open source community or collaborating on your own projects, knowing how to properly fork and generate pull requests is essential. Unfortunately, it's quite easy to make mistakes or not know what you should do when you're initially learning the process. I know that I certainly had considerable initial trouble with it, and I found a lot of the information on GitHub and around the internet to be rather piecemeal and incomplete - part of the process described here, another there, common hangups in a different place, and so on.

In an attempt to coallate this information for myself and others, this short tutorial is what I've found to be fairly standard procedure for creating a fork, doing your work, issuing a pull request, and merging that pull request back into the original project.

Creating a Fork

Just head over to the GitHub page and click the "Fork" button. It's just that simple. Once you've done that, you can use your favorite git client to clone your repo or j

@bgilbert
bgilbert / README.md
Last active December 31, 2015 07:39
Script to delete the label image from an Aperio SVS file

Moved

This script has moved.

@odebeir
odebeir / gist:5038467
Last active April 1, 2016 23:10
Color deconvolution for python cf : A. C. Ruifrok and D. A. Johnston, “Quantification of histochemical staining by color deconvolution.,” Analytical and quantitative cytology and histology / the International Academy of Cytology [and] American Society of Cytology, vol. 23, no. 4, pp. 291–9, Aug. 2001.
def convert_to_optical_densities(rgb,r0,g0,b0):
OD = rgb.astype(float)
OD[:,:,0] /= r0
OD[:,:,1] /= g0
OD[:,:,2] /= b0
return -np.log(OD)
def color_deconvolution(rgb,r0,g0,b0,verbose=False):
stain_OD = np.asarray([[0.18,0.20,0.08],[0.01,0.13,0.0166],[0.10,0.21,0.29]]) #hematoxylin, eosyn, DAB