This is a gist I made. I fully don't get it yet.
Seems unnecessary for my purposes.
//This is a few lines of code that produces a base36 timestamp | |
function mkTt() { return new Date().getTime().toString(36)} | |
//len is any number between 0 and 10 | |
function mkId(len=3){ return new Date().getTime().toString(36)+"."+Math.random().toString(36).slice(13-len).padStart(len,"0") } | |
//this will pull the date portion of the mkId and will parse the mkTt | |
function parseDate(tinyId){new Date(parseInt(tinyId.split(".")[0],36))} |
/** | |
* Will find all permutations of the given set of 'dominos' that can | |
* be laid in a single line end to end to form a valid domino train. | |
*/ | |
function start() { | |
const dominos = ['05','60','54','66','40','43','21','35','03','24','32','52','11']; | |
dominos.forEach(domino=>{ | |
let remaining = dominos.filter(d=>d!=domino); | |
lookForValidTrain([domino], remaining); | |
}) |
<script lang="ts"> | |
/** | |
* When a file is dropped here (or selected via browsing) this is the function that will be called back | |
*/ | |
export let fileCallback: (file: File)=>any | |
function handleDrop(ev: any) { | |
// Prevent default behavior (Prevent file from being opened) | |
ev.preventDefault(); | |
(<HTMLDivElement>ev.target).classList.remove("drug"); |
var workbook = SpreadsheetApp.getActiveSpreadsheet(); | |
var daySheet = workbook.getSheetByName("Days"); | |
var weekSheet = workbook.getSheetByName("Weeks"); | |
var monthSheet = workbook.getSheetByName("Months"); | |
var yearSheet = workbook.getSheetByName("Years"); | |
///////////////////////////////////////////////////// | |
//This is the function that is triggered each night// | |
///////////////////////////////////////////////////// | |
function oneAM(){ |