Skip to content

Instantly share code, notes, and snippets.

View akey7's full-sized avatar

Alicia Key akey7

View GitHub Profile
@akey7
akey7 / ffmpeg_combine_stills.sh
Created March 25, 2020 04:45
Combine still images into a movie with ffmpeg
# This assumes frame numbering of 4 integer places like 0001, 0020, 0300, etc
ffmpeg -r 30 -s 1920x1080 -i heme_%04d.png -vcodec libx264 -crf 15 -pix_fmt yuv420p heme_movie.mp4
@akey7
akey7 / animation_capture.namd
Created March 24, 2020 18:21
NAMD NVT run configuration capturing lots of position frames for smooth animations
# Obviously, this will need to be modified for the particular situations at hand,
# but capturing every 50 timesteps at 2 fs/step is a good starting point for a
# 30 fps animation.
# Run with the following command line
# charmrun ++remote-shell ssh +p10 $(which namd2) 5eui_nvt.namd | tee 5eui_minimize_log.out
structure 5eui_nvt.psf
coordinates 5eui_nvt.pdb
@akey7
akey7 / namd_start.txt
Last active April 20, 2020 22:59
Start NAMD on 10 cores of CPU with or without GPU
# This is what executes NAMD on 5 cores of a 6 core i5 CPU and
# accelerates with the available GPU.
# Note that you should NOT tell it number of threads in the +p
# It will handle making multiple threads per core if it needs to.
# That is why I am NOT telling it +p10 to use 5 cores. Just tell
# it the number of cores!
#
# The isomalloc_sync has to do with some memory warning I was
# getting, and this fixed it.
charmrun +isomalloc_sync +p5 $(which namd2) 2K39_eq_10M.namd.conf | tee 2K39_eq_10M.namd.log
@akey7
akey7 / TF_FORCE_GPU_ALLOW_GROWTH.txt
Created July 12, 2019 02:18
In case tensor flow does not work, try this.
TF_FORCE_GPU_ALLOW_GROWTH=true jupyter notebook
@akey7
akey7 / README.md
Created July 7, 2019 18:58 — forked from curran/README.md
The Iris Dataset

This is the "Iris" dataset. Originally published at UCI Machine Learning Repository: Iris Data Set, this small dataset from 1936 is often used for testing out machine learning algorithms and visualizations (for example, Scatter Plot). Each row of the table represents an iris flower, including its species and dimensions of its botanical parts, sepal and petal, in centimeters.

The HTML page provides the basic code required to load the data and display it on the page (as JSON) using D3.js.

Built with blockbuilder.org

web counter
@akey7
akey7 / stdout_logger.py
Created June 16, 2019 08:23
Create a logger
# Credit where credit is due:
# https://stackoverflow.com/questions/14058453/making-python-loggers-output-all-messages-to-stdout-in-addition-to-log-file
# I am just keeping a copy of it here for easy reference in the future
import logging
import sys
self.log = logging.getLogger()
self.log.setLevel(logging.DEBUG)
handler = logging.StreamHandler(sys.stdout)
@akey7
akey7 / get_environment_variable.py
Created June 16, 2019 08:21
Environment variable: get it
target_dir = os.environ['IMAGE_TARGET_DIR'] if 'IMAGE_TARGET_DIR' in os.environ else '/home/me'
source_dir = os.environ['IMAGE_SOURCE_DIR'] if 'IMAGE_SOURCE_DIR' in os.environ else '/home/me'
@akey7
akey7 / timestamp.py
Created June 16, 2019 08:18
Timestamp in a string
from datetime import datetime as dt
now = dt.now()
timestamp = f'{now.year}-{now.month}-{now.day}-{now.hour}-{now.minute}-{now.second}'
@akey7
akey7 / US Zip Codes from 2013 Government Data
Created May 15, 2019 01:51 — forked from erichurst/US Zip Codes from 2013 Government Data
All US zip codes with their corresponding latitude and longitude coordinates. Comma delimited for your database goodness. Source: http://www.census.gov/geo/maps-data/data/gazetteer.html
This file has been truncated, but you can view the full file.
ZIP,LAT,LNG
00601,18.180555, -66.749961
00602,18.361945, -67.175597
00603,18.455183, -67.119887
00606,18.158345, -66.932911
00610,18.295366, -67.125135
00612,18.402253, -66.711397
00616,18.420412, -66.671979
00617,18.445147, -66.559696
00622,17.991245, -67.153993
@akey7
akey7 / bst_traverse_load_sorted_list.py
Created February 25, 2019 05:10
Insert and traverse a BST. Also load a BST from a sorted list. Python.
class BSTNode:
def __init__(self, val):
self.val = val
self.left = None
self.right = None
class BST:
"""
Implements a binary search tree