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 / 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 / Get-Started-DotMotif.ipynb
Last active April 6, 2022 22:00
Searching for Motifs in MICrONS Data
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.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@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

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)

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
@j6k4m8
j6k4m8 / vol
Created December 11, 2019 20:41
Raspberry Pi Volume Control. Use with `vol 70` for 70% volume
#!/usr/bin/env python
import subprocess
import sys
if len(sys.argv) > 1:
subprocess.check_output("amixer sset 'PCM' {}%".format(sys.argv[1]), shell=True)
else:
print(subprocess.check_output("amixer get 'PCM' | grep '%'", shell=True).split()[3].strip('[]'))
@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(),
)
@j6k4m8
j6k4m8 / tv
Created November 5, 2017 01:25
rpi scripts
#!/usr/bin/env python
import os
import sys
import subprocess
if (sys.argv[1] == 'on'):
subprocess.check_output('/opt/vc/bin/tvservice -p', shell=True)
if len(sys.argv) > 2 and sys.argv[2] == "up":