Skip to content

Instantly share code, notes, and snippets.

View andreescocard's full-sized avatar
🏠
Working from home

André Escocard andreescocard

🏠
Working from home
View GitHub Profile
@andreescocard
andreescocard / connectgranite.py
Created March 15, 2024 02:28
Sort text in arrow style
# List of strings
texts = [
"Big Size",
"Easy to fab",
"Can be storage outside",
"No fillers and cracks",
"Nice bookmatch",
"Requires minimum maintenance",
"Affordable price"
]
{
"paragraphs": [
{
"position": 0,
"content": "<div class=\"importantinfo__card\">\n <div class=\"importantinfo__card-title\">My Title</div>\n <div class=\"importantinfo__card-subtitle\">My subtitle long text My subtitle long text My subtitle long text <a href=\"#\" class=\"importantinfo__card-subtitlelink\">with link</a></div>\n</div>"
},
{
"position": 1,
"content": "<div class=\"importantinfo__card\">\n <div class=\"importantinfo__card-title\">My Title</div>\n <div class=\"importantinfo__card-subtitle\">My subtitle long text My subtitle long text My subtitle long text <a href=\"#\" class=\"importantinfo__card-subtitlelink\">with link</a></div>\n</div>"
},
@andreescocard
andreescocard / options.html
Created March 17, 2023 01:07
checkbox with numbers inside
<style>
ul {
padding: 0;
margin: 0;
clear: both;
}
li{
list-style-type: none;
<!DOCTYPE html>
<html>
<head>
<title>Simple Command Voice</title>
</head>
<body>
<p id="output"></p>
<button id="start">Click and say something!</button>
<script>
(() => {
@andreescocard
andreescocard / carousel.js
Last active August 2, 2022 15:06
slick carousel 2 slides mobile
@andreescocard
andreescocard / simplecache.php
Last active May 3, 2022 02:48
PHP simple cache
<?php
function cache_file() {
// something to (hopefully) uniquely identify the resource
$cache_key = md5($_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] . $_SERVER['QUERY_STRING']);
$cache_dir = '/tmp/phpcache';
return $cache_dir . '/' . $cache_key;
}

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@andreescocard
andreescocard / dataset from event.js
Created May 26, 2021 20:27 — forked from r37r0m0d3l/dataset from event.js
javascript get dataset from event
// as property
event.currentTarget.dataset.id
// as array element
event.currentTarget.dataset['id']
// jquery method
$(event.currentTarget).data('id')