Skip to content

Instantly share code, notes, and snippets.

@-moz-document url-prefix("https://trello.com/") {
.list-wrapper {
width: 500px;
}
.list-card {
max-width: unset;
padding-top: 1em;
padding-bottom: 2em;
}
body {
@AWare
AWare / convert.js
Created September 26, 2020 12:54
Google fit weight to garmin
const fs = require("fs");
const parse = require("csv-parse/lib/sync");
const moment = require("moment");
const dateRegex = /\d\d\d\d-\d\d-\d\d\.csv/;
const dates = fs.readdirSync(".").filter((_) => dateRegex.test(_));
//Garmin doesn't want to import fitbit data without bmi and body fat, so just make something up.
const h = 1 ** 2; //height in meters ** 2
const bf = 100; // current body fat percentage
const current = 0; //current weight
@AWare
AWare / polyfill-aliases.json
Last active January 30, 2019 15:50
The documentation for polyfill.io no longer includes aliases. Maybe this is for the best, but here they are for reference. This is the output from listAliases() on polyfill-library.
{
"all": [
"Array.from",
"Array.isArray",
"Array.of",
"Array.prototype.@@iterator",
"Array.prototype.copyWithin",
"Array.prototype.entries",
"Array.prototype.every",
"Array.prototype.fill",
@AWare
AWare / tldr.js
Created November 29, 2017 15:41
my bad hack
[...document.querySelectorAll('p,span,a,h1,h2,h3')].filter(e =>e.textContent.length > 140 ).map((p,n) => {
p.textContent = p.textContent.substring(0,(140 + 140 * Math.pow(Math.E,(-n/4))))
})
[...document.querySelectorAll('p,span,a,h1,h2,h3')].filter(e =>e.textContent.length > 10 ).map((p,n) => { p.textContent = "tldr;" });
@AWare
AWare / showless.js
Created May 16, 2013 17:54
Inelegant hack to click all the read more links in google plus.
//https://developer.mozilla.org/en-US/docs/DOM/document.createEvent
function simulateClick(cb) {
var evt = document.createEvent("MouseEvents");
evt.initMouseEvent("click", true, true, window,
0, 0, 0, 0, 0, false, false, false, false, 0, null);
//var cb = document.getElementById("checkbox");
var canceled = !cb.dispatchEvent(evt);
if(canceled) {
// A handler called preventDefault