Skip to content

Instantly share code, notes, and snippets.

View infusion's full-sized avatar

Robert Eisele infusion

View GitHub Profile
@infusion
infusion / up.sh
Last active February 28, 2020 11:09
Update all OSX deps
#!/bin/sh
set -e
set -x
brew update && brew upgrade
npm -g update
for package in $(npm -g outdated --parseable --depth=0 | cut -d: -f3)
@infusion
infusion / rational-pow.py
Last active November 25, 2018 14:10
Calculates the rational power using newton method
# Copyright Robert Eisele https://www.xarg.org/
from fractions import Fraction
import math
# Calculates (a/b)^(c/d) if solution is rational
def pow(a, b, c, d):
xn = Fraction(int(math.pow(a, c / float(d))), int(math.pow(b, c / float(d))))
abc = Fraction(a, b)**c