Skip to content

Instantly share code, notes, and snippets.

@jakirkham
jakirkham / numpy_pickle_protocol_5.py
Created August 1, 2018 04:48 — forked from ogrisel/numpy_pickle_protocol_5.py
Draft use of pickle protocol 5 (PEP 574) for zero-copy numpy array pickling
from pickle5 import Pickler, load, PickleBuffer
import copyreg
import os
import numpy as np
import time
import gc
import io
from multiprocessing import get_context
@jakirkham
jakirkham / shmemctypes.py
Created June 23, 2018 15:00 — forked from shawnchin/shmemctypes.py
shm_open() version of multiprocessing.sharedctypes.RawArray
#
# Based on multiprocessing.sharedctypes.RawArray
#
# Uses posix_ipc (http://semanchuk.com/philip/posix_ipc/) to allow shared ctypes arrays
# among unrelated processors
#
# Usage Notes:
# * The first two args (typecode_or_type and size_or_initializer) should work the same as with RawArray.
# * The shared array is accessible by any process, as long as tag matches.
# * The shared memory segment is unlinked when the origin array (that returned
@jakirkham
jakirkham / dask_example_copy_access.py
Last active June 1, 2018 17:17 — forked from hanslovsky/dask_example.py
Show dask array in BigDataViewer
import ctypes
import dask.array
import dask.array.image
import dask.array as da
import numpy as np
import os
import pathlib
import skimage.io
import subprocess
import sys
@jakirkham
jakirkham / 20180123.txt
Created January 23, 2018 16:03 — forked from pkgw/20180123.txt
Check Travis CI queue for conda-forge feedstocks
Repo 1 of 3827 ...
Repo 101 of 3827 ...
Repo 201 of 3827 ...
Repo 301 of 3827 ...
Repo 401 of 3827 ...
Repo 501 of 3827 ...
Repo 601 of 3827 ...
Repo 701 of 3827 ...
Repo 801 of 3827 ...
Repo 901 of 3827 ...
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, division
import itertools
import operator
import hashlib
import pickle
import sys
import zarr
@jakirkham
jakirkham / cython_line_profiler.ipynb
Created November 9, 2017 18:48 — forked from tillahoffmann/cython_line_profiler.ipynb
Demonstration of line-by-line profiling for `cython` functions.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jakirkham
jakirkham / render_env.py
Created September 15, 2017 18:10 — forked from ericdill/render_env.py
Render the dependency graph for your conda environment (needs graphviz!)
import json
import glob
from os.path import join, basename
# install this with "conda install -c conda-forge python-graphviz"
import graphviz as gv
# path to your conda environment
path = '/tmp/foo'
dg = gv.Digraph(filename='env-%s' % basename(path), format='svg')
@jakirkham
jakirkham / update_token.py
Created August 14, 2017 23:47 — forked from jjhelmus/update_token.py
Python script to update the Anaconda upload token in conda-forge feedstocks
from __future__ import print_function
import os
import requests
import ruamel.yaml
with open(os.path.expanduser('~/.conda-smithy/circle.token'), 'r') as fh:
circle_token = fh.read().strip()
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jakirkham
jakirkham / github-brand-colors-aug-2015.css
Created March 7, 2017 04:55 — forked from christopheranderton/github-brand-colors-aug-2015.css
Official Github Brand Colors (August 20, 2015) from the GitHub internal CSS framework (Primer) version 2.3.3 at: http://primercss.io/colors/ [Note: Photoshop users. You can download the raw file (.css) and import the swatches just like a .aco file (more recent versions of Photoshop).
/* # OFFICIAL GITHUB BRAND COLORS
--------------------------------------------------------------------
Official Github Brand Colors (August 20, 2015) from the
GitHub internal CSS framework (Primer) version 2.3.3
Source URI: http://primercss.io/colors/
1.a = Github Branding Color Swatches
-------------------------------------------------------------------- */
.swatch-github-blue {
background-color:#4078c0;