Skip to content

Instantly share code, notes, and snippets.

View j6k4m8's full-sized avatar
🧠
hi

Jordan Matelsky j6k4m8

🧠
hi
View GitHub Profile
@j6k4m8
j6k4m8 / bowtie.css
Created May 1, 2014 23:34
.bowtie{}
.bowtie {
height: 0;
border-top: 10px solid black;
border-left: 10px solid white;
border-right: 10px solid white;
border-bottom: 10px solid black;
width: 29px;
-webkit-transform: rotate(90deg);
padding: 4px;
border-radius: 10px;
@j6k4m8
j6k4m8 / vertical-center.css
Created September 6, 2014 23:46
vertical-center{}
position: absolute;
top: 0; bottom: 0; left: 0; right: 0;
height: 50%;
width: 50%;
margin: auto;
@j6k4m8
j6k4m8 / RAMON2obj.m
Last active August 29, 2015 14:26
RAMONVolume to .obj conversion
function RAMON2obj(matrix_or_ramon, id, show)
%% TO_OBJ Convert an annotation to a 3D .obj file
% For use with CAJAL (https://github.com/openconnectome/cajal)
% Pass an anno'd RAMONVolume or its data
% and this will export a file called
% `export-{id}.obj` that contains a mesh
% of the selected anno, where {id} is the
% id that was exported.
% TO_OBJ(matrix, id) Convert annotation #id from matrix.data to .obj
% TO_OBJ(matrix, id, 1) SLOW! Convert as above, but show first
@j6k4m8
j6k4m8 / shanatova.html
Created September 15, 2015 16:28
apples and honey in pure CSS.
<html>
<head>
<style media="screen">
* {
box-sizing: border-box;
}
html, body {
background: beige;
}
"""
Requires ocpy, h5py, PIL (all but PIL are pip-installable)
"""
import ocpy.access.download
from ocpy.convert import png
from ocpy.access.Request import *
import os, glob
import h5py
import ndio.remote.OCPMeta as ndlims
import ndio.remote.OCP as OCP
oo = OCP()
ndl = ndlims()
secret = ?????
species = {
'Mouse': 'M. musculus',
@j6k4m8
j6k4m8 / Python Sphinx Auto-Documentation.md
Created January 24, 2016 20:16
My method for autodoc'ing my code consistently each time.

How to Build Docs

The B directory (your usual working directory for development) should have a sister directory A at the same level, which is checked out to the gh-pages branch.

# from B directory:
sphinx-apidoc -o ../ndio-docs ./ndio/
cd docs
make html
@j6k4m8
j6k4m8 / download-as-png.py
Last active January 29, 2016 15:53
An ndio script to download a full dataset
# Jordan Matelsky (https://github.com/j6k4m8)
# uses ndio>=0.1.3
#
# Usage: python download-as-png.py token channel res startslice stopslice
# Example:
# python download-as-png.py kasthuri11 image 3 1100 1110
# (Will download slices 1100-1110 of the kasthuri11 dataset at resolution 3)
import ndio.remote.neurodata as ND
import ndio.convert.png as ndpng
@j6k4m8
j6k4m8 / genobj.py
Created March 6, 2016 05:07
Generates a 3D .obj from a neurodata (neurodata.io) token/channel pair.
#!/usr/bin/env python
"""
Written by Jordan Matelsky (@j6k4m8)
March 5, 2016
"""
import sys
import os
import argparse
@j6k4m8
j6k4m8 / chemecar.ino
Last active March 21, 2016 20:47
LED Photoresistor Arduino Read
/* CHEMICAL CAR: ARDUINO SKETCH
* You shouldn't have to change anything below the define lines.
* Contact Jordan (jm@jhu.edu) with questions.
*/
#define MOTOR 7
#define SENSOR A0
#define LED13 13
#define DELAY 5000