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"); |
//#region ---- ABOUT ---- | |
/** | |
* This Code is meant to be published as a Google Apps Script WebApp. | |
* | |
* # Pre-work | |
* ## Setting Trigger to add a new row each day. | |
* 1. Set a "Trigger" in Apps Script to run the `oneAM()" function each night between midnight and 1am. This makes a new row for you & copies formulas to it. | |
* | |
* ## Making the web app | |
* 1. Click Publish > Deploy as web app... |
date: 2012-08-30T00:00:00.000Z tags: