Skip to content

Instantly share code, notes, and snippets.

View davidagold's full-sized avatar

David Gold davidagold

View GitHub Profile
@davidagold
davidagold / .bash_profile
Created May 24, 2018 19:47 — forked from natelandau/.bash_profile
Mac OSX Bash Profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
@davidagold
davidagold / autoreason.jl
Last active October 7, 2018 16:58
Simplify arithmetic expressions
function simplify(e::Expr)
_simplify(e)
end
_simplify(e) = e
function _simplify(e::Expr)
# apply the following only to expressions that call a function on arguments
if e.head == :call
op = e.args[1] # in such expressions, `args[1]` is the called function
simplified_args = [ _simplify(arg) for arg in e.args[2:end] ]