Skip to content

Instantly share code, notes, and snippets.

View Gioni06's full-sized avatar
👨‍💻
Working from home

Jonas D. Gioni06

👨‍💻
Working from home
View GitHub Profile
@Gioni06
Gioni06 / aspect-ratio.js
Created April 20, 2022 15:09
Calculate the aspect ratio given a width and a height
// calculate the aspect ration given a width and a height
function aspectRatio(width, height) {
// calculate the greates common denominator of two numbers
function gcd(a, b) {
if (b === 0) {
return a;
}
return gcd(b, a % b);
}
var gcdValue = gcd(width, height);
{
"colors": {
"space-gray": "var(--color-space-gray, rgba(178, 179, 183, 1))"
},
"text-styles": {
"hero-headline-font-family": "var(--text-style-hero-headline-font-family, Arial)",
"hero-headline-font-size": "var(--text-style-hero-headline-font-size, 32px)",
"hero-headline-font-weight": "var(--text-style-hero-headline-font-weight, 500)",
"hero-headline-letter-spacing": "var(--text-style-hero-headline-letter-spacing, 0.5px)",
"hero-headline-line-height": "var(--text-style-hero-headline-line-height, 40px)",
{
"colors": [{
"name": "Space Gray",
"type": "color",
"meta": {
"description": "A metallic grayish tint that stands out but doesn't overpower your eye when looking at it",
"category": "Monochrome",
"created_at": "2021-11-03T14:10:49.593Z",
"updated_at": "2021-12-03T14:10:49.593Z"
},
@Gioni06
Gioni06 / fun-with-arrays.js
Last active August 13, 2021 15:04
Fun with Arrays
const sourceA = [
[...Array(5).keys()].map((value) => {
return { ref: "sourceA", value };
}),
[...Array(13).keys()].map((value) => {
return { ref: "sourceB", value };
}),
[...Array(22).keys()].map((value) => {
return { ref: "sourceC", value };
}),
@Gioni06
Gioni06 / query.sql
Created December 22, 2019 08:19
Use SequelPro with legacy password encryption for local development
ALTER USER root@localhost IDENTIFIED WITH mysql_native_password BY 'root';
@media screen and (max-width: 480px) {
.hidden-mobile {
display: none!important;
visibility: hidden!important;
opacity: 0!important;
}
}
@media screen and (min-width: 481px) {
.hidden-desktop {
@Gioni06
Gioni06 / hide-software-update-prompts.sh
Created December 1, 2019 07:02
Hide MacOS Software Update prompts
# http://osxdaily.com/2019/10/16/hide-macos-catalina-software-update-mac/
#
# Hide catalina update
sudo softwareupdate --ignore "macOS Catalina"
# Reset
sudo softwareupdate --reset-ignored
@Gioni06
Gioni06 / utility.scss
Created November 17, 2019 20:09
"padding" and "margin" utility classes with SCSS
$space: 0.25rem;
// position shortcuts.
$positions: 'x', 'y', 't', 'b', 'l', 'r';
// range multiplier
$ranges: 1, 2, 3, 4, 5, 6, 7, 8, 'auto';
@function autoOrValue($sp, $ra) {
@if($ra == 'auto') {
<a href="#" title="Inline SVG" class="logo">
<svg viewBox="0 0 406 71"><path fill="black" d="M62.5 48.4l14-5.5c1.9 4.9 6 7.3 11.2 7.3 4.8 0 7.4-2.2 7.4-4.8 0-2.9-5.2-3.7-11.4-4.9-9.6-1.7-19.3-5-19.3-16.5 0-9 8.7-17 21.9-16.8 12 0 18.8 4.9 22.7 12.4l-13 5.5c-1.4-3.5-5-5.9-9.8-5.9-4.8 0-7 2-7 4.4 0 2.4 3.1 3.2 11.1 4.8 9 1.8 19.4 5 19.4 16.6 0 7.8-7.3 18.1-22.7 17.9-12.9 0-20.7-5.1-24.5-14.5zM114.7 50.5l10.3-5.4c2.9 4.9 7.6 7.8 13.7 7.8 6.4 0 9.7-3.3 9.7-7.1 0-4.3-6.2-5.2-12.9-6.6-9.1-1.9-18.5-4.9-18.5-15.9 0-8.5 8-16.3 20.7-16.2 10 0 17.3 4 21.5 10.4l-9.5 5.2c-2.5-3.7-6.6-6.1-12-6.1-6.1 0-9.2 3-9.2 6.4 0 3.9 4.9 4.9 12.6 6.6 8.8 1.9 18.7 4.8 18.7 15.9 0 7.4-6.4 17.3-21.6 17.2-11.2.2-19-4.3-23.5-12.2zM166.8 35.5c0-16 11.7-28.2 27.7-28.2 15.4 0 27.4 10.6 27.4 27v3.5h-47.1c1.1 10.6 9.4 17.8 20.1 17.8 8.7 0 14.8-4.5 18.1-11l7.2 3.5c-4.9 9.3-13.3 14.9-25.3 14.9-17-.1-28.1-11.8-28.1-27.5zm8.4-5.4h38.2c-1.5-9.6-8.6-15.5-18.9-15.5-9.6 0-17.1 6.5-19.3 15.5zM228.9 8.3h5.9v10.1c3.6-6.5 10.8-11.1 19.9-11.1 14.3 0 23.6
.col-3-grid {
display: grid;
grid-template-columns: 1fr 1fr 1fr;
column-gap: 20px;
}
.col {
padding: 20px;
background-color: #e6e5e5;
}