This file contains hidden or 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
| var num = "174"; | |
| kaprekar(num); | |
| function kaprekar(num){ | |
| s1 = parseInt(num.split("").sort().join("")); | |
| s2 = parseInt(num.split("").sort(function(a,b){return b-a}).join("")); | |
| n = (s1 > s2) ? s1 -s2 : s2 - s1; | |
| (s1 > s2) ? console.log(s1 + " - " + s2 + " = " + n) : console.log(s2 + " - " + s1 + " = " + " = " + n); | |
| if(n === parseInt(num)){ |
This file contains hidden or 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
| /* | |
| * @fileoverview Program to free the content in kindle books as plain HTML. | |
| * | |
| * This is largely based on reverse engineering kindle cloud app | |
| * (https://read.amazon.com) to read book data from webSQL. | |
| * | |
| * Access to kindle library is required to download this book. | |
| */ | |
| // The Kindle Compression Module copied from http://read.amazon.com application |
This file contains hidden or 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
| const MY_DOMAIN = "agodrich.com" | |
| const START_PAGE = "https://www.notion.so/gatsby-starter-notion-2c5e3d685aa341088d4cd8daca52fcc2" | |
| const DISQUS_SHORTNAME = "agodrich" | |
| addEventListener('fetch', event => { | |
| event.respondWith(fetchAndApply(event.request)) | |
| }) | |
| const corsHeaders = { | |
| "Access-Control-Allow-Origin": "*", |
This file contains hidden or 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
| // READ THIS BEFORE RUNNING! | |
| // Run just ONCE in a Roam daily Notes folder with ONLY files such as: December 31st, 2016.md or April 1st, 2016.md | |
| // Do not include any other files in the folder (source_path)! | |
| // | |
| // DISCLAIMER: I am not responsible for any loss of information or files. Use this at your own risk. | |
| const fs = require('fs'); | |
| const replace = require("replace"); | |
| const source_path = './obsidian/journals'; // Source Daily Notes folder |
OlderNewer