Skip to content

Instantly share code, notes, and snippets.

View jgreener64's full-sized avatar

Joe Greener jgreener64

View GitHub Profile
@trey
trey / happy_git_on_osx.md
Last active February 18, 2024 10:46
Creating a Happy Git Environment on OS X

Creating a Happy Git Environment on OS X

Step 1: Install Git

brew install git bash-completion

Configure things:

git config --global user.name "Your Name"

git config --global user.email "you@example.com"

@andrewbolster
andrewbolster / Random Three Vector.py
Last active August 5, 2023 11:58
Generate a random 3D unit vector with uniform spherical distribution
def random_three_vector():
"""
Generates a random 3D unit vector (direction) with a uniform spherical distribution
Algo from http://stackoverflow.com/questions/5408276/python-uniform-spherical-distribution
:return:
"""
phi = np.random.uniform(0,np.pi*2)
costheta = np.random.uniform(-1,1)
theta = np.arccos( costheta )
@leeping
leeping / measure_min_image.py
Created February 24, 2017 19:06
Find the closest contact between a protein and its periodic images in an MD trajectory
#!/usr/bin/env python
import mdtraj as md
import time
import numpy as np
from copy import deepcopy
import itertools
import sys
t0 = time.time()
@sbliven
sbliven / cif2pdb.py
Created April 26, 2017 19:27
Convert mmCIF files to PDB format using biopython
#!/usr/bin/env python
"""
Script to convert mmCIF files to PDB format.
usage: python cif2pdb.py ciffile [pdbfile]
Requires python BioPython (`pip install biopython`). It should work with recent version of python 2 or 3.
@author Spencer Bliven <spencer.bliven@gmail.com>
"""
using CUDAnative
using CuArrays
using StaticArrays
using BenchmarkTools
using Makie
using Test
@inline function lennard_jones(dr, ϵ::T, σ::T) where T
invr2 = inv(sum(abs2, dr) + T(1E-7))
six_term = (σ ^ 2 * invr2) ^ 3
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.