Skip to content

Instantly share code, notes, and snippets.

View horlah's full-sized avatar
👨‍💻

Emmanuel Aina horlah

👨‍💻
View GitHub Profile
@krishaantechnology
krishaantechnology / tailwind.config.js
Created February 12, 2023 01:25
Tailwind CSS: Shake Animation
const defaultTheme = require('tailwindcss/defaultTheme');
module.exports = {
purge: [
'./vendor/laravel/framework/src/Illuminate/Pagination/resources/views/*.blade.php',
'./storage/framework/views/*.php',
'./resources/views/**/*.blade.php',
'./resources/js/**/*.vue',
],
function loadModule(filename, module, require) {
const wrappedSrc = `
function(module, exports, require) {
${fs.readFileSync(filename, 'utf8')}
}(module, module.exports, require)
`;
eval(wrappedSrc);
}
@joeytwiddle
joeytwiddle / async-await-forEach-alternatives.md
Last active September 12, 2025 19:54
Do not use forEach with async-await

Do not use forEach with async-await

TLDR: Use for...of instead of forEach() in asynchronous code.

For legacy browsers, use for(...;...;...) or [].reduce()

To execute the promises in parallel, use Promise.all([].map(...))

The problem