Skip to content

Instantly share code, notes, and snippets.

View verlok's full-sized avatar
💭
Coding. Always.

Andrea Verlicchi verlok

💭
Coding. Always.
View GitHub Profile
@verlok
verlok / index.html
Last active November 16, 2020 14:21
Capping image fidelity to 2x to minimize loading time on high-end mobile phones
<picture>
<!-- Landscape tablet / computers -->
<source media="(min-width: 1024px)"
sizes="(min-width: 1280px) 33vw, 50vw"
srcset="https://placehold.it/640 640w,
https://placehold.it/1024 1024w,
https://placehold.it/1280 1280w,
https://placehold.it/1440 1440w">
<!-- Portrait tablets -->
<source media="(min-width: 415px)"
@verlok
verlok / snippet.js
Last active July 1, 2020 10:01
Extract Trello card category, name and due date from Trello's first column
let out = [];
$(".list").first().find(".list-card-details").each((index, elem) => {
let $elem = $(elem);
let cardName = $elem.find(".js-card-name").text();
let cardCategory = $elem.find(".js-card-labels").text();
let cardDueDate = $elem.find(".js-due-date-text").text();
let dueDateString = (cardDueDate === "") ? "" : `(${cardDueDate})`;
out.push(`${cardCategory}: ${cardName} ${dueDateString}`);
});
out.join("\n");
@verlok
verlok / empty.html
Created November 19, 2018 11:39
Empty HTML file to start from scratch
<html lang="en">
<head>
<meta charset="utf-8">
<title>________________</title>
<meta name="description" content="________________">
<meta name="author" content="________________">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="main.css">
</head>