Skip to content

Instantly share code, notes, and snippets.

View nathanielatom's full-sized avatar

Adam Suban-Loewen nathanielatom

View GitHub Profile
@nathanielatom
nathanielatom / Phase Mask Sims.ipynb
Created December 22, 2021 21:58
SWI - Phase Mask Simulations Exploring Fitted Reciprocal Tetration
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nathanielatom
nathanielatom / DLT.ipynb
Created November 12, 2021 00:58
Direct Linear Transform (DLT)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nathanielatom
nathanielatom / pdiddy_island_mars_selfie.py
Created October 3, 2020 05:13
Find out where Mars is, in the sky at P'diddy Island, PEI, ON, Canada.
#!/usr/bin/env python
"""
Find out where Mars is, in the sky at P'diddy Island, PEI, ON, Canada.
"""
import datetime
# ! pip install skyfield
from skyfield.api import load, Topos
@nathanielatom
nathanielatom / georeference.sh
Last active August 11, 2022 22:25
Map Georeferencer Using QGIS
# Install: https://qgis.org/en/site/ (GDAL gets installed automatically)
# Follow the guide here: https://expeditionportal.com/forum/threads/create-georeference-pdf-files-for-avenzas-pdf-maps-app.137086/
# QGIS Version used: 3.10.4
# 0. The general idea is to identify the coordinates of several points on the map, whether
# landmarks or grid intersections, and use that to calculate the geographic reference metadata.
# 1. Convert map file to TIFF (.tiff) image format. Use uncompressed if given the option.
# The Mac Preview application seems better than ImageMagick at creating high quality tiff files, but any
# imaging program with reasonable resolution conversion capability should work. If you don't have one,

Keybase proof

I hereby claim:

  • I am nathanielatom on github.
  • I am nathanielatom (https://keybase.io/nathanielatom) on keybase.
  • I have a public key ASAhs7DyfGGy1ft_EOVnP4kkuvMtqJIc5NJSPcZ-yTfSVgo

To claim this, I am signing this object:

@nathanielatom
nathanielatom / shared_links.py
Last active December 4, 2018 03:06
Shared Links: provides a context manager for opening web resources like shared links.
@nathanielatom
nathanielatom / gui-less-message-box
Last active October 11, 2017 20:26
A (near) one-line cross-platform GUI-less message box
import webbrowser
import base64
def browser_msg(message):
webbrowser.open("data:{mime_type};base64,{data}".format(mime_type='text/html', data=base64.b64encode(message.encode()).decode()))
browser_msg("Hello world")
# Mac
brew cask install chromium
pip install selenium
wget https://chromedriver.storage.googleapis.com/2.32/chromedriver_mac64.zip
unzip chromedriver_mac64.zip -d /usr/local/bin/
rm chromedriver_mac64.zip
# python
from selenium import webdriver
options = webdriver.ChromeOptions()
@nathanielatom
nathanielatom / bokeh_audio_player.py
Last active January 18, 2024 05:53
Custom Bokeh Model for audio playback (along with a sample plot that has a playback span cursor).
# encoding: utf-8
import bokeh.models as bkm
import bokeh.core as bkc
from bokeh.util.compiler import JavaScript
class AudioPlayerModel(bkm.layouts.Column):
"""
Audio player using https://howlerjs.com/.
@nathanielatom
nathanielatom / install_tensorflow_linux.sh
Created July 8, 2016 03:57
Pseudo-script (meant to be read and executed line by line) for installing Tensorflow with GPU support on linux.
# Tensorflow 0.9 with GPU from binary for ubuntu linux 64 bit. Assumes anaconda python 2 is already installed.
cd ~
conda update conda
conda update anaconda
# update environment variables
echo 'export CUDA_HOME="/usr/local/cuda"' >> setup-env.sh
echo 'export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$CUDA_HOME/lib64"' >> setup-env.sh
echo 'export PATH="$CUDA_HOME/bin:$PATH"' >> setup-env.sh
sudo cp setup-env.sh /etc/profile.d/
rm setup-env.sh