Skip to content

Instantly share code, notes, and snippets.

@assaflavi
assaflavi / computeSunrise.js
Created January 6, 2021 17:58 — forked from Tafkas/computeSunrise.js
A simple sunrise-sunset algorithm taken from http://williams.best.vwh.net/sunrise_sunset_algorithm.htm in JavaScript
function computeSunrise(day, sunrise) {
/*Sunrise/Sunset Algorithm taken from
http://williams.best.vwh.net/sunrise_sunset_algorithm.htm
inputs:
day = day of the year
sunrise = true for sunrise, false for sunset
output:
time of sunrise/sunset in hours */
#!/usr/bin/env python
"""
piphub - shortcut for user-only editable install from GitHub
usage:
piphub org[/repo] [name]
`name` only needs to be specified if it differs from `repo`.
If the organization, repo, and name all have the same value (e.g. ipython),