Skip to content

Instantly share code, notes, and snippets.

Avatar
🙃
:)

Nando Sangenetto nandosangenetto

🙃
:)
View GitHub Profile
@nandosangenetto
nandosangenetto / between-hours.js
Last active Mar 4, 2020
Function to valid if a specific time is between two hours, including when pass through midnight
View between-hours.js
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;
View getRides.js
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 / README.me
Last active May 17, 2018
Compress and convert images
View README.me
# 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
You can’t perform that action at this time.