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 / README.md
Last active January 24, 2020 21:31
Comparator overrides

Access REST endpoints in "object" dot-notation and pandas-like index-notation in Python.

Example usage:

Posts = RemoteDataProvider(
    list_all=lambda: requests.get("https://jsonplaceholder.typicode.com/posts").json(),
    get_one=lambda x: requests.get(f"https://jsonplaceholder.typicode.com/post/{x}").json(),
)
EC2_NAME = "x1.32xlarge"
# https://stackoverflow.com/a/55109870/979255
def get_uptime():
with open('/proc/uptime', 'r') as f:
uptime_seconds = float(f.readline().split()[0])
return uptime_seconds

new session

the first time after boot, start a new tmux session:

tmux

(it's working if your shell has a green bar at the bottom)

@j6k4m8
j6k4m8 / Set-Up-Blender-Infinite-Background.py
Created August 17, 2020 18:20
Set up an infinite Blender background (beveled plane), with Camera, Focus-empty, and DOF
import math
import bpy
def add_infinite_background(coll_name = None):
mesh = bpy.data.meshes.new("InfiniteBackground")
obj = bpy.data.objects.new(mesh.name, mesh)
col = bpy.data.collections.get("Collection")
col.objects.link(obj)
bpy.context.view_layer.objects.active = obj
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@j6k4m8
j6k4m8 / Monomorphisms-and-Isomorphisms-In-Python.ipynb
Created March 23, 2021 15:15
Monomorphisms vs Isomorphisms: Three Search Approaches in Python
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@j6k4m8
j6k4m8 / Citation Diversity Statement Generator.ipynb
Last active April 13, 2021 20:53
Understand gender and race distributions of the papers you cite
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@j6k4m8
j6k4m8 / download-tweets.ipynb
Created April 22, 2021 14:20
Download an archive of a user's tweets and render a simple HTML page (no JS required)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@j6k4m8
j6k4m8 / Get-Started-Intern.ipynb
Last active April 28, 2021 15:07
Get started downloading neuroscience data with Intern and BossDB
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@j6k4m8
j6k4m8 / NiceNotebooks.md
Last active December 12, 2021 01:50
How to write friendly Jupyter Notebooks

Jupyter Notebook Conventions

Manifesto

Notebooks are designed for easy reproducibility and code-sharing. Babysitting and debugging someone else's notebook sucks. Don't curse your friends with this burden!

When a user opens your notebook, they should be able to run all cells in order without any additional intervention.

Inputs that must be made to enable the code to run (e.g. password prompts, API tokens, etc) should be requested as soon as the notebook starts running.