Skip to content

Instantly share code, notes, and snippets.

View freeman-lab's full-sized avatar

Jeremy Freeman freeman-lab

View GitHub Profile

An opinionated guide to installing Python on an M1 or M2 Mac in 2025

The following should work on a fresh Mac. It should also work if you already have some kind of Python installed, but depending on what you've done, you might run into trouble.

I'm assuming just basic familiarity with opening the terminal app.

First, install the xcode development tools if you haven't already (it's a ~200MB download) by typing this into the terminal

xcode-select --install
@freeman-lab
freeman-lab / gbl-analysis-presentation.md
Last active September 14, 2016 17:04
gbl analysis presentation

principles

  • commitment to open source
  • scalability
  • transparency
  • modularity
  • standardization
  • iteration
  • avoiding reinvention
@freeman-lab
freeman-lab / example-neurofinder-notebook.ipynb
Created July 6, 2016 17:41
example neurofinder notebook
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@freeman-lab
freeman-lab / local-nmf.py
Created July 4, 2016 03:39
neurofinder algorithm : local nmf
# neurofinder submission
# local nmf
#
# requirements:
# thunder-python v1.2.0
# thunder-extraction v1.1.0
import json
import thunder as td
from extraction import NMF
@freeman-lab
freeman-lab / render-light.js
Created June 1, 2016 04:23
red sphere with lightning in regl
const mat4 = require('gl-mat4')
const sphere = require('primitive-icosphere')
const fit = require('canvas-fit')
const normals = require('angle-normals')
const regl = require('regl')()
const camera = require('lookat-camera')()
var mesh = sphere(1, {
subdivisions: 5
})
@freeman-lab
freeman-lab / render.js
Last active May 31, 2016 18:39
looming red sphere in regl
const mat4 = require('gl-mat4')
const sphere = require('primitive-icosphere')
const regl = require('regl')()
const camera = require('lookat-camera')()
var mesh = sphere(1, {subdivisions: 1})
const cube = regl({
frag: `
precision mediump float;
@freeman-lab
freeman-lab / example.txt
Created April 5, 2016 18:01
minidocs highlight js test
```python
# create shifted copies
from numpy import arange
from scipy.ndimage.interpolation import shift
```
```python
# create shifted copies
@freeman-lab
freeman-lab / thunder-api.md
Last active March 31, 2016 14:23
draft thunder api docs

data types

images

count()

Explicit count of the number of items.

For lazy or distributed data, will force a computation.

@freeman-lab
freeman-lab / terrible-neurofinder-algorithm.py
Last active June 8, 2016 18:46
example neurofinder algorithm : uses a fixed two-pixel region for all neurons
import json
datasets = ['00.00.test', '00.01.test', '01.00.test', '01.01.test', '02.00.test', '02.01.test', '03.00.test', '04.00.test', '04.01.test']
submission = []
for dataset in datasets:
result = {'dataset': dataset, 'regions': [{'coordinates': [[0, 0], [0, 1]]}]}
submission.append(result)
@freeman-lab
freeman-lab / random-neurofinder-algorithm.py
Last active June 8, 2016 18:49
example neurofinder algorithm : generates random regions
import json
from numpy import zeros, random, asarray, where, ones
from scipy.ndimage.morphology import binary_closing, binary_dilation
datasets = ['00.00.test', '00.01.test', '01.00.test', '01.01.test', '02.00.test', '02.01.test', '03.00.test', '04.00.test', '04.01.test']
dims = [500,500]
margin = 20
n = 200