Skip to content

Instantly share code, notes, and snippets.

View mnzsss's full-sized avatar

Gabriel Menezes mnzsss

  • Cox Automotive
  • São Paulo, SP
  • LinkedIn in/mnzs
View GitHub Profile
@Gomah
Gomah / 1. useResponsiveVariant.ts
Last active October 30, 2024 09:00
Responsive Variants with CVA, class-variance-authority
import { useMediaQuery } from 'usehooks-ts'
import { useMemo } from 'react';
import { screens } from '.generated/screens';
/*
// You can also define the screens object manually if you don't want to use a prebuilt script.
const screens = {
sm: '640px',
md: '768px',
@enesien
enesien / shadcn-multi-tag-input.md
Last active October 4, 2024 03:10
shadcn multiple tag input

shadcn/ui multi tag input component

A react tag input field component using shadcn, like one you see when adding keywords to a video on YouTube. Usable with Form or standalone.

Preview

image

Standalone Usage

@rinogo
rinogo / job.service.spec.ts
Last active May 20, 2024 17:09
Integration Testing a NestJS Service that leverages Prisma
import { Test, TestingModule } from '@nestjs/testing';
import { PrismaService } from '../prisma.service';
import { JobService } from './job.service';
import * as crypto from 'crypto';
describe('JobService', () => {
let service: JobService;
let prisma: PrismaService;
beforeEach(async () => {
@broofa
broofa / checkForUndefinedCSSClasses.js
Last active January 21, 2024 17:22
ES module for detecting undefined CSS classes (uses mutation observer to monitor DOM changes). `console.warn()`s undefined classes.
/**
* Sets up a DOM MutationObserver that watches for elements using undefined CSS
* class names. Performance should be pretty good, but it's probably best to
* avoid using this in production.
*
* Usage:
*
* import cssCheck from './checkForUndefinedCSSClasses.js'
*
* // Call before DOM renders (e.g. in <HEAD> or prior to React.render())
<h1 align="center">
<br>
<img src="YOUR_LOGO_URL" alt="YOUR_PROJECT_NAME" width="120">
<br>
<br>
YOUR_PROJECT_NAME
</h1>
<p align="center">A little description about your project</p>
<h1 align="center">
<br>
<img src="YOUR_LOGO_URL" alt="YOUR_PROJECT_NAME" width="120">
<br>
<br>
YOUR_PROJECT_NAME
</h1>
<p align="center">A little description about your project</p>
@Dirack
Dirack / git.md
Created November 19, 2019 18:43 — forked from leocomelli/git.md
Lista de comandos úteis do GIT

GIT

Estados

  • Modificado (modified);
  • Preparado (staged/index)
  • Consolidado (comitted);

Ajuda

@rumansaleem
rumansaleem / clean-up-arch-linux.md
Created May 28, 2019 08:51
Instructions to clean up Arch Linux (Manjaro)

Contents

  • Clean pkg cache
  • Remove unused packages (orphans)
  • Clean cache in /home
  • remove old config files
  • Find and Remove
    • duplicates
    • empty files
    • empty directories
  • broken symlinks
@reecelucas
reecelucas / useScrollBlock.js
Last active November 13, 2024 08:19
React hook to enable/disable page scroll
import { useRef } from 'react';
const safeDocument = typeof document !== 'undefined' ? document : {};
/**
* Usage:
* const [blockScroll, allowScroll] = useScrollBlock();
*/
export default () => {
const scrollBlocked = useRef();
@kylealwyn
kylealwyn / merge-deep.js
Created December 8, 2016 21:15
recursively merge two javascript objects
/**
* Simple is object check.
* @param item
* @returns {boolean}
*/
function isObject(item) {
return (item && typeof item === 'object' && !Array.isArray(item));
}
/**