Skip to content

Instantly share code, notes, and snippets.

View jdrusso's full-sized avatar

JD Russo jdrusso

View GitHub Profile
@jdrusso
jdrusso / script.md
Last active February 3, 2023 22:23
Forged in Facial Hair: The Quest for the Ultimate Neckbeard

Background

Introduction: Welcome to "Forged in Facial Hair", where we gather the nerdiest of the nerdiest to compete for the title of the ultimate neckbeard champion. In each episode, contestants will be given a challenge to grow and shape their neckbeards to perfection, with the help of our panel of expert judges.

Judges:

  • Chatgpt: The AI judge who has seen it all and is ready to dish out the most hilarious critiques.
  • Chuck “The Beard” Johnson: A former professional wrestler, who retired early to focus on his true passion - growing the most impressive beard in the world.
  • Dr. Fernanda “The Fuzz” Fuzzleton: A renowned dermatologist, who has a PhD in beardology and is here to share her knowledge and expertise on beard grooming.
@jdrusso
jdrusso / Script.md
Last active February 3, 2023 21:33
Chaos in the Kitchen: The Rebel Bake-Off and Bob's Bizarre Baking Buddy

ACT 1

Narrator: In this maximum security prison, the inmates are given the opportunity to participate in a chocolate chip making workshop. But what starts as a routine cooking class quickly takes a turn to the dark side.

Cut to footage of prisoners in aprons, working in a kitchen setting.

Narrator: The prisoners are challenged to make chocolate chips using the worst ingredients possible. They're given a leopard, a piece of iron rebar, and a piece of computer memory to incorporate into their recipe.

Cut to footage of the prisoners, looking bewildered and trying to figure out what to do with their strange ingredients.

@jdrusso
jdrusso / mdtraj.md
Last active September 27, 2021 19:09
MDTraj PPC Build Notes

mdtraj ppc build notes

My notes on using the below build script

In the conda env you’re planning on doing this in, run conda install numpy cython scipy pybind11 pythran astunparse pytables pandas

Run the below commands. After ml python3, you’ll need to ml conda and then conda activate <your env>
(I pasted the commands from TACC into a bash script, this step may not be necessary if you run it line by line on the CLI, not sure if your conda env will stay loaded)

#!/usr/bin/python
import h5py
class H5Diff:
def __init__(self, ref_file, test_file):
self.ref_file = h5py.File(ref_file, 'r')
self.test_file = h5py.File(test_file, 'r')
@jdrusso
jdrusso / avail.sh
Last active January 3, 2020 19:56
Simple script. Invoke with 'avail.sh [resource_type]' where resource_type matches to the options output in the gres field of sinfo %G. Try "avail.sh 2080" or "avail.sh 1080" if you have either of those in your cluster, or just "avail.sh gpu".
#!/bin/bash
# Default to looking for 2080s
if [[ $# -eq 0 ]]; then
RESOURCE="rtx2080"
else
RESOURCE=$1
echo "Looking for resource " $RESOURCE
fi
try:
process_id = os.environ['WM_PROCESS_INDEX']
num_gpus = os.environ['SLURM_GPUS']
#TODO: make sure this modulo is actually doing the right thing
if self.platform.getName() == 'OpenCL':
platform_properties['OpenCLDeviceIndex'] = process_id % num_gpus
elif self.platform.getName() == 'CUDA':
platform_properties['CudaDeviceIndex'] = process_id % num_gpus
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDLeOM9cT7VQC1RW6B3SNWj+a2W++2jP92bmKCFHjfOtH77GOw+wmkfdi7sgMoNCM7B3MVVAUUtsHXHzNoP3QibYuIL/AEyPhPYlHV4o5zkTM+01v023UQr72MDLru2z7GA7foczHZOceG53rqWagh/tAFTpRRWaaUsaje2V1eGnuu8yGKfNgfmuaYD7zD7p6uZIWt+3aYDL0Ge4iXa+ZV76GSNk3gNRcm5XFGkJSe4y0KqmS3c5BNnY7U+uDHSMeHVhK0AKJu+tAiRsbydlbmm6wAQpkgzmOMLqVVM3n8KO8vfomGblFv3HJ2SBQfXt5TlV5aQFvQd9t+H24vq+5cR jd@Hawking
@jdrusso
jdrusso / edgy.py
Last active February 11, 2019 18:13
Add edges to graph
# Add edges connecting vertices
# These edges represent stargates between systems.
for system in sdict.keys():
source = sdict[system]['vertex']
for adjacent in sdict[system]['adjacent']:
try:
target = sdict[adjacent]['vertex']
except KeyError:
@jdrusso
jdrusso / visitor.py
Created February 11, 2019 18:05
DFS Visitor Snippet
class DFS(DFSVisitor):
def __init__(self, name):
self.name = name
self.routes = []
self.visited = []
self.current = None
# If you've found a loop, record the stack
{
"name": "App_Name_Test",
"author": {
"name": "Jesus Rambo",
"email": "my@email.com"
},
"description": "Frontend for script",
"version": "0.1.0",
"private": true,
"dependencies": {