Skip to content

Instantly share code, notes, and snippets.

let rides = [];
let lastRideId = undefined;
const getRides = () => {
const tripNodes = Array.from(
document.querySelectorAll(".trip-expand__origin")
);
const id = tripNodes[0].dataset.target.replace("#trip-", "");
const hasNewRides = lastRideId !== id;
@NandoSangenetto
NandoSangenetto / between-hours.js
Last active March 4, 2020 18:05
Function to valid if a specific time is between two hours, including when pass through midnight
const splitStringTime = str => str.split(":").map(str => parseInt(str, 10));
const leftZero = str => ("0" + str).slice(-2);
function isBetweenTimes({ startTime, endTime, nowTime }) {
const [hourStart, minuteStart] = splitStringTime(startTime);
const [hourEnd, minuteEnd] = splitStringTime(endTime);
const [hourNow, minuteNow] = splitStringTime(nowTime);
const startMinutes = hourStart * 60 + minuteStart;
@NandoSangenetto
NandoSangenetto / README.me
Last active August 24, 2022 08:22
Compress and convert images
# Convert images from folder
## Installation
You need to download libwebp and put in the shell script folder.
You must have installed the jpegoptim, giflossy (gifsicle), pngquant and imagemagick library.
## Usage
Convert folder and put results in the results folder
@NandoSangenetto
NandoSangenetto / HideBat.vbs
Last active April 22, 2023 19:51
Update Google Domain's Dynamic DNS on Windows with batch files
scriptdir = CreateObject("Scripting.FileSystemObject").GetParentFolderName(WScript.ScriptFullName)
CreateObject("Wscript.Shell").Run scriptdir + "\updateip.bat", 0, True