Skip to content

Instantly share code, notes, and snippets.

@hachesilva
hachesilva / _spacing.scss
Created January 7, 2021 21:14 — forked from XanderLuciano/_spacing.scss
This is a simple sass (rather scss) recreation of a bootstrap like spacing utility which allows you to quickly and easily set margin and padding sizes through classes like `mx-3`, `p-2`, and `pt-5`. You can define spacing values in $spacing and add or remove shorthand properties with the $prefixes variable. This uses `!important` to override any…
@mixin simpleSpace {
// margin and padding values
$spacings: (
0,
.25rem,
.5rem,
1rem,
1.5rem,
2rem,
@hachesilva
hachesilva / send-accented-a-on-altgr-a.ahk
Created June 23, 2021 03:44
AutoHotkey Script to Send accented a when pressing AltGr+A or Left-Ctrl+Right-Alt+A
; Send accented a when pressing AltGr+A or Left-Ctrl+Right-Alt+A
; This fixes Windows 10 issue preventing to type accented a on keyboard layouts
; that doesn't use DeadKeys
<^>!a::Send {Asc 160}
@hachesilva
hachesilva / cheatsheet.md
Last active October 15, 2021 04:18
Cheat sheets for my apps
<?php
/**
* Add the code below to your theme's functions.php file
* to add a confirm password field on the register form under My Accounts.
*/
function woocommerce_registration_errors_validation($reg_errors, $sanitized_user_login, $user_email) {
global $woocommerce;
extract( $_POST );
if ( strcmp( $password, $password2 ) !== 0 ) {
@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

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 / 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
@hachesilva
hachesilva / update-alternatives.sh
Created March 3, 2023 21:52
Select python version using update-alternatives
sudo update-alternatives --config python3
@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 */

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