Skip to content

Instantly share code, notes, and snippets.

Josh Kaplan josh-kaplan

Block or report user

Report or block josh-kaplan

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View jk.zsh-theme
local ret_status="%(?:%{$fg_bold[green]%}➜ :%{$fg_bold[red]%}➜ )%{$reset_color%}"
local user="%{$FG[236]%}%n%{$fg[white]%}@%{$FG[236]%}%m%{$reset_color%}"
local pwd="%{$fg[blue]%}%c%{$reset_color%}"
PROMPT='${ret_status}%{$fg_bold[grey]%}${user} ${pwd} $(git_prompt_info)'
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[blue]%}(%{$FG[134]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} "
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}) %{$fg[green]%}+%{$reset_color%}/%{$fg[red]%}-"
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%})"
@josh-kaplan
josh-kaplan / pset2-2.jl
Created Feb 14, 2018
Computations for FESS 1 Problem Set #2, Problem #2
View pset2-2.jl
#!/usr/bin/env julia
################################################################################
# pset2-2.jl
#
# Josh Kaplan
# _jk@jhu.edu
#
# Computations for Problem Set #2, Problem #2.
################################################################################
@josh-kaplan
josh-kaplan / pset2-1.jl
Last active Feb 14, 2018
Calculations for FESS 1 Problem Set #2, Problem #1
View pset2-1.jl
#!/usr/bin/env julia
################################################################################
# pset2-1.jl
#
# Josh Kaplan
# _jk@jhu.edu
#
# Computations for Problem Set #2, Problem #1.
################################################################################
@josh-kaplan
josh-kaplan / M03_Kinetic_Energy_v3.m
Created Jun 12, 2017
Bisection Method (More accurate).
View M03_Kinetic_Energy_v3.m
%% 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_v2.m
Created Jun 11, 2017
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.
View M03_Kinetic_Energy_v2.m
%% 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 Jun 11, 2017
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.
View M03_Kinetic_Energy.m
%% 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;
View sight-reduction-geosat.py
"""
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 / sight_reduction.py
Created Apr 16, 2017
A script used to solve sight reduction homework problems for navigation class.
View sight_reduction.py
"""
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
View jdk.zsh-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 Oct 2, 2016
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.
View spacex_its_volume.m
% 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.
You can’t perform that action at this time.