Skip to content

Instantly share code, notes, and snippets.

View ruiokada's full-sized avatar

Rui Okada ruiokada

View GitHub Profile
@ruiokada
ruiokada / .block
Last active September 18, 2019 17:39 — forked from cmgiven/.block
Map to Force-Directed Graph
license: mit
height: 600
@ruiokada
ruiokada / suntimes.js
Last active October 17, 2024 01:23
Calculate sunrise/sunset times from latitude/longitude coordinates using Javascript.
/**
* Calculates today's sunrise and sunset hours in local time (or in the given tz) for the given latitude, longitude.
* The tz parameter is mainly for the possible circumstance that your system timezone does not match the location
* you are currently at.
*
* Computations are based on the formulas found in:
* https://en.wikipedia.org/wiki/Julian_day#Converting_Julian_or_Gregorian_calendar_date_to_Julian_Day_Number
* https://en.wikipedia.org/wiki/Sunrise_equation#Complete_calculation_on_Earth
*
* @method suntimes

Keybase proof

I hereby claim:

  • I am ruiokada on github.
  • I am rusou (https://keybase.io/rusou) on keybase.
  • I have a public key whose fingerprint is AACB 0F9F D21C 37B4 7790 FE90 305E 0DB5 D0C5 3826

To claim this, I am signing this object: