Skip to content

Instantly share code, notes, and snippets.

View marceloglacial's full-sized avatar
💻
Coding

Marcelo Freitas marceloglacial

💻
Coding
View GitHub Profile
@marceloglacial
marceloglacial / gist:225498005299493be4b8712e5c97a3e2
Last active June 25, 2025 15:52
GitHub Copilot Instructions for React and Next.js Projects
# GitHub Copilot Instructions for React and Next.js Projects
This file provides guidelines for GitHub Copilot to ensure consistent, clean, and performant code generation for React and Next.js applications.
## General Principles
- **Clean Code:** Prioritize **readability, maintainability, and reusability**.
- **Conciseness:** Aim for concise and expressive code.
- **Descriptive Naming:** Use clear and descriptive names for variables, functions, components, and files (e.g., `getUserProfile`, `ProductCard`, `useAuth`).
- **DRY (Don't Repeat Yourself):** Extract reusable logic into functions, custom hooks, or components.
// https://stackoverflow.com/questions/40774697/how-can-i-group-an-array-of-objects-by-key
const groupArrayBy = (arr, prop) => {
return arr.reduce(function (groups, item) {
const val = item[prop]
groups[val] = groups[val] || []
groups[val].push(item)
return groups
}, {})
}
const boookList = [
{
id: 1,
category: "action"
},
{
id: 2,
category: "fiction"
},
{
@marceloglacial
marceloglacial / php-codesniffer-global-install.sh
Last active January 7, 2020 15:41
PHP CodeSniffer global install
curl -sSL https://squizlabs.github.io/PHP_CodeSniffer/phpcbf.phar -o phpcbf.phar
chmod a+x phpcbf.phar
sudo mv phpcbf.phar /usr/local/bin/phpcbf
@marceloglacial
marceloglacial / index.html
Created March 1, 2019 20:17
Progress Bar with tabs
<h1>Progress Bars (with tabs)</h1>
<p>According text value</p>
<div class="tab-container">
<div class="tab active">
<h2 class='tab-title'>Tab 1</h2>
<ul class="container">
<li class="loading"><span class="progress">10%</span></li>
<li class="loading"><span class="progress">20%</span></li>
<li class="loading"><span class="progress">30%</span></li>
<li class="loading"><span class="progress">40%</span></li>