This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// import astronomy-engine | |
let astronomy = require('astronomy-engine'); | |
let tithis = [ "Shukl Prti. (Br 1)", "Shukl Dwit. (Br 2)", "Shukl Trit. (Br 3)", "Shukl Catu. (Br 4)", "Shukl Panch. (Br 5)", "Shukl Sast. (Br 6)", "Shukl Sapt. (Br 7)", "Shukl Asht. (Br 8)", "Shukl Nava. (Br 9)", "Shukl Dasm. (Br 10)", "Shukl Ekad. (Br 11)", "Shukl Dwad. (Br 12)", "Shukl Tryod. (Br 13)", "Shukl Caturd. (Br 14)", | |
"Purnima (Full Moon)", | |
"Krshn Prti. (Da 1)", "Krshn Dwit. (Da 2)", "Krshn Trit. (Da 3)", "Krshn Catu. (Da 4)", "Krshn Panch. (Da 5)", "Krshn Sast. (Da 6)", "Krshn Sapt. (Da 7)", "Krshn Asht. (Da 8)", "Krshn Nava. (Da 9)", "Krshn Dasm. (Da 10)", "Krshn Ekad. (Da 11)", "Krshn Dwad. (Da 12)", "Krshn Tryod. (Da 13)", "Krshn Caturd. (Da 14)", | |
"Amavasya (New Moon)"]; | |
function getTithi(date) { | |
let moonFactor = astronomy.MoonPhase(date) / 12; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; {:n 0 | |
;; :l {:n 1 :l nil :r nil} | |
;; :r {:n 2 :l nil :r {:n 3 | |
;; :l nil | |
;; :r nil}}} | |
;; 0 | |
;; / \ | |
;; 1 2 | |
;; / \ / \ | |
;; nil nil nil 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bb | |
(require '[babashka.curl :as curl]) | |
(def sicp-url "https://mitpress.mit.edu/sites/default/files/sicp/full-text/book/") | |
(def pages (map #(str "book-Z-H-" % ".html" ) (rest (range 39)))) | |
(def data (map #(vector (str sicp-url %) %) pages)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name JSON Viewer | |
// @match * | |
// @run-at document-start | |
// ==/UserScript== | |
let pretags = document.querySelectorAll( | |
'[style="word-wrap: break-word; white-space: pre-wrap;"]', | |
); |