Skip to content

Instantly share code, notes, and snippets.

@hachesilva
hachesilva / emailregex.js
Created November 22, 2023 14:47
Email regex validation - https://emailregex.com
const emailregex = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
@hachesilva
hachesilva / .htaccess
Created September 16, 2023 01:31
Automatically serve files with UTF-8 encoding on Apache server
# Source: https://nicolasbouliane.com/blog/force-apache-serve-utf-8-default-htaccess
# Serve all text files as unicode
AddDefaultCharset utf-8
# Set encoding on individual file types
AddCharset utf-8 .html .css .js .php
@hachesilva
hachesilva / typescale.scss
Created June 21, 2023 21:43
Typography scales, sass version
// Source: https://typescale.com/
// Typography scales
$minor_second: 1.067;
$major_second: 1.125;
$minor_third: 1.200;
$major_third: 1.250;
$perfect_fourth: 1.333;
$augmented_fourth: 1.414;
$perfect_fifth: 1.500;
@hachesilva
hachesilva / settings.jsonc
Created June 12, 2023 19:00 — forked from hyperupcall/settings.jsonc
VSCode config to disable popular extensions' annoyances (telemetry, notifications, welcome pages, etc.)
// I'm tired of extensions that automatically:
// - show welcome pages / walkthroughs
// - show release notes
// - send telemetry
// - recommend things
//
// This disables all of that stuff.
// If you have more config, leave a comment so I can add it!!
{

Automating Daily Reports, because fuck it, really...

Each day at our company, developers are required to document their activities, painstakingly jotting down their daily work and future plans. A monotonous chore that I just really dislike.

So now, there's a scribe for that :

auto-dr-

Code

@hachesilva
hachesilva / system-colors.css
Created March 24, 2023 14:54
Dark-light color schemes using System default colors
/*
Source: https://blog.jim-nielsen.com/2021/css-system-colors/
*/
/* Set global color scheme without setting a background */
:root {
color-scheme: light dark;
}
/* Use system colors for dropdowns */
@hachesilva
hachesilva / update-alternatives.sh
Created March 3, 2023 21:52
Select python version using update-alternatives
sudo update-alternatives --config python3
@hachesilva
hachesilva / endv-bbox.txt
Last active February 8, 2022 04:23
End bbox notes
Start the project using a target domain (com, uk, es) and a backend env (staging):
TARGET=com BACKEND_DOMAIN=staging yarn start
/big/boss -> admin panel for developers
big/boss/cms/usage -> List of pages and their URLs where objects are in use
(gnome icon) -> components demo
https://partner-hernan-s-birchbox.myshopify.com/admin/online_store/preferences?tutorial=unlock
https://courses.wesbos.com/account/access/60464648b730de59f5ddaa4b
https://medium.com/@danwebb/better-shopify-theme-development-with-parcel-js-704f17f367fc

How to setup a practically free CDN

I've been using [Backblaze][bbz] for a while now as my online backup service. I have used a few others in the past. None were particularly satisfactory until Backblaze came along.

It was - still is - keenly priced at a flat $5 (£4) per month for unlimited backup (I've currently got just under half a terabyte backed-up). It has a fast, reliable client. The company itself is [transparent about their operations][trans] and [generous with their knowledge sharing][blog]. To me, this says they understand their customers well. I've never had reliability problems and everything about the outfit exudes a sense of simple, quick, solid quality. The service has even saved the day on a couple of occasions where I've lost files.

Safe to say, I'm a happy customer. If you're not already using Backblaze, [I highly recommend you do][recommend].

Taking on the big boys with B2

@hachesilva
hachesilva / gmail-most-frequent-senders.sh
Last active April 30, 2024 14:22
Find the most frequent senders in your Gmail account
# Source: https://ryanfb.github.io/etc/2019/08/26/finding_the_most_frequent_senders_in_your_gmail_account.html
# Download a copy of your gmail account from https://takeout.google.com/
grep '^From:' ~/Downloads/YOUR_TAKEOUT_FILE.mbox | cut -d'<' -f2 | tr -d '>' | sort | uniq -c | sort -rn > gmail-frequent-senders.txt