Skip to content

Instantly share code, notes, and snippets.

View distancify-oscar's full-sized avatar

Oscar distancify-oscar

View GitHub Profile
@distancify-oscar
distancify-oscar / regex.txt
Last active January 15, 2022 22:35
Regex tricks by Oscar
The following Regex matches any letter in any language, and spaces
Great for email / username / name inputs
/[\p{L} ]+/g
@distancify-oscar
distancify-oscar / chevron_up_white_icon.svg
Last active November 10, 2023 17:36
Useful Components
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@distancify-oscar
distancify-oscar / delete-product.sql
Last active June 24, 2024 14:09
SQL tricks by Oscar
--Deleting a fielddata from product
Begin transaction
select * from Products.VariantFieldData p
where p.OwnerSystemId = 'BBC232C1-ED8D-4381-853B-23DBB96907CA'
and FieldDefinitionId = '_images'
delete from Products.VariantFieldData
@distancify-oscar
distancify-oscar / debounce-run-last-call.js
Last active December 3, 2021 10:03
JS tricks by Oscar
const debounce = (callback, wait) => {
let timeoutId = null;
return (...args) => {
window.clearTimeout(timeoutId);
timeoutId = window.setTimeout(() => {
callback.apply(null, args);
}, wait);
};
}
.textContainer {
background-image: url(imageUrl);
background-clip: text;
color: transparent;
}