Skip to content

Instantly share code, notes, and snippets.

View josh-kaplan's full-sized avatar

Josh Kaplan josh-kaplan

View GitHub Profile
@josh-kaplan
josh-kaplan / .bashrc
Created July 22, 2015 23:31
Just a copy of my .bashrc file.
#!/bin/bash
# Aliases
alias ls="ls -G"
alias l="ls $*"
alias ll="ls -l"
alias lls="ls -l $*"
alias .="cd ~/Dev"
alias ..="cd .."
alias ...="cd ../../"
@josh-kaplan
josh-kaplan / jdk.zsh-theme
Last active August 29, 2015 14:25
A modification to the robbyrussell theme
local ret_status="%(?:%{$fg_bold[green]%}∴ :%{$fg_bold[red]%}∴ %s)"
PROMPT='${ret_status}%{$fg_bold[green]%}%p%{$fg_bold[grey]%}%n%{$fg_bold[white]%}@%{$fg_bold[grey]%}%m%{$fg_bold[green]%}%u %{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%}%{$reset_color%}'
ZSH_THEME_GIT_PROMPT_PREFIX="git: (%{$fg[red]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} "
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%})%{$fg[yellow]%}✗%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%})"
@josh-kaplan
josh-kaplan / spacex_its_volume.m
Last active October 2, 2016 22:45
A script to calculate human-usable living space of SpaceX's ITS ship. After watching some of Elon Musk's presentation, I could quite wrap my head around 100 people on that ship. So here's the math and some perspective. Turns out 100 people may not be unreasonable.
% SpaceX ITS Volumetric Capacity
% spacex_its_volume.m
%
% Josh Kaplan
% contact@joshkaplan.org
%
% SpaceX claims that the spaceship that sits atop ITS can carry 100+ people
% per ship.
%
% The ship is slightly larger than the Saturn V, which carried 3 people.
local ret_status="%(?:%{$fg_bold[green]%}∴ :%{$fg_bold[red]%}∴ %s)"
PROMPT='${ret_status}%{$fg_bold[green]%}%p%{$fg_bold[grey]%}%n%{$fg_bold[white]%}@%{$fg_bold[grey]%}%m%{$fg_bold[green]%}%u %{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%}%{$reset_color%}'
ZSH_THEME_GIT_PROMPT_PREFIX="git: (%{$fg[red]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} "
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%})%{$fg[yellow]%}✗%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%})"
@josh-kaplan
josh-kaplan / sight_reduction.py
Created April 16, 2017 18:40
A script used to solve sight reduction homework problems for navigation class.
"""
Sight Reduction
Calculate position on 2000 June 21 2100 UTC
Star Observed Altitude
------- ----------- --------
Regulus 20h 39m 23s 37.4204
Antares 20h 45m 47s 20.3226
Kochab 21h 10m 34s 47.2050
"""
Sight Reduction
Similar to the last sight reduction one, but modified to use geostationary satellites.
"""
from __future__ import division
import math
from math import sin, cos, tan, asin, acos, atan
@josh-kaplan
josh-kaplan / M03_Kinetic_Energy_v2.m
Created June 11, 2017 23:48
Newton's Method. This will work with either MATLAB or Octave. Used to determine the maximum speed at which kinetic energy can be described by the Newtonian equation with an error with a specified tolerance of relativistic energy.
%% Newtonian vs. Relativistic Energy Accuracy - Using Newton's Method
% Determines the maximum speed a particle can have such that its
% kinetic energy described as 0.5*m*v^2 with an error of no greater
% than <tolerance>.
close all; clear all; clc;
% Input - The tolerance of the accuracy of the Newtonian kinetic energy
% compared to the relativistic energy.
tolerance = .005;
@josh-kaplan
josh-kaplan / M03_Kinetic_Energy.m
Last active June 11, 2017 23:49
Bisection Method. This will work with either MATLAB or Octave. Used to determine the maximum speed at which kinetic energy can be described by the Newtonian equation with an error with a specified tolerance of relativistic energy.
%% Newtonian vs. Relativistic Energy Accuracy
% Determines the maximum speed a particle can have such that its
% kinetic energy described as 0.5*m*v^2 with an error of no greater
% than <tolerance>.
close all; clear all; clc;
% Input - The tolerance of the accuracy of the Newtonian kinetic energy
% compared to the relativistic energy.
tolerance = .005;
@josh-kaplan
josh-kaplan / M03_Kinetic_Energy_v3.m
Created June 12, 2017 00:02
Bisection Method (More accurate).
%% Newtonian vs. Relativistic Energy Accuracy
% Determines the maximum speed a particle can have such that its
% kinetic energy described as 0.5*m*v^2 with an error of no greater
% than <tolerance>.
close all; clear all; clc;
% Input - The tolerance of the accuracy of the Newtonian kinetic energy
% compared to the relativistic energy.
tolerance = .005;
@josh-kaplan
josh-kaplan / pset2-1.jl
Last active February 14, 2018 03:19
Calculations for FESS 1 Problem Set #2, Problem #1
#!/usr/bin/env julia
################################################################################
# pset2-1.jl
#
# Josh Kaplan
# _jk@jhu.edu
#
# Computations for Problem Set #2, Problem #1.
################################################################################