Skip to content

Instantly share code, notes, and snippets.

View ygorluiz's full-sized avatar
🎯
Focusing

Ygor Luiz ygorluiz

🎯
Focusing
View GitHub Profile
@ygorluiz
ygorluiz / hooks.ts
Created November 23, 2023 17:33 — forked from DonHuskini/hooks.ts
useMediaQuery & useBreakpoints hooks for handling conditional rendering on multiple breakpoints (Adapted for Next.js)
// -------------------------
// useMediaQuery
import { useState, useEffect, useLayoutEffect } from "react";
export function useMediaQuery(query: string) {
const [matches, setMatches] = useState(false);
useEffect(() => {
const media = window.matchMedia(query);
env:
TERM: xterm-256color
font:
size: 14
normal:
family: "Dank Mono"
style: Regular
bold:
style: Bold
type ChildrenProps = {
readonly gift: string;
}
type ParentProps = {
readonly children: React.ReactNode;
readonly gift: string;
}
const
@ygorluiz
ygorluiz / typing-api.ts
Created August 4, 2023 20:57 — forked from taricov/typing-api.ts
Typescript: Typing Your API Requests - Generics Hacks #4
// STEP 1
// setting variables
const url:string = "https://dummyjson.com";
const endPoint: string = "/users"
// u could use /posts or /products for other data types
// STEP 2
async function GetAllItems(
url: string, endpoint: string
@ygorluiz
ygorluiz / wsl.md
Created March 22, 2023 19:20 — forked from felipefontoura/wsl.md
Master Class #009 - https://youtu.be/SWvs4KtHv-4
@ygorluiz
ygorluiz / README.md
Created March 17, 2023 10:15 — forked from BoGnY/README.md
[WINDOWS] How to enable auto-signing Git commits with GnuPG for programs that don't support it natively

[WINDOWS] How to enable auto-signing Git commits with GnuPG for programs that don't support it natively

This is a step-by-step guide on how to enable auto-signing Git commits with GPG for every applications that don't support it natively (eg. GitHub Desktop, Eclipse, Git Tower, ...)

Requirements

  • Install GPG4Win: this software is a bundle with latest version of GnuPG v2, Kleopatra v3 certificate manager, GNU Privacy Assistant (GPA) v0.9 which is a GUI that uses GTK+, GpgOL and GpgEX that are respectively an extension for MS Outlook and an extension for Windows Explorer shell
  • Install Git for Windows: so you can have a *nix based shell, this software is a bundle with latest version of Git which use MINGW environment, a Git bash shell, a Git GUI and an extension for Windows Explorer shell (Make sure your local version of Git is at least 2.0, otherwise Git don't have support for automatically sign your commits)
  • Verify
@ygorluiz
ygorluiz / Header.tsx
Created March 4, 2023 20:53 — forked from whoisryosuke/Header.tsx
Styled Components / Typescript - Header component with variants using a switch statement
import React, { memo } from 'react'
import styled from 'styled-components'
import { t, ti } from '../../utils/getTheme'
interface Props {
variant: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'
children: JSX.Element
as?: JSX.Element
}
@ygorluiz
ygorluiz / ExampleUsage.tsx
Created February 22, 2023 10:33 — forked from matthewsimo/ExampleUsage.tsx
Help Storybook properly handle the relevant Stitches variants & props
import type * as Stitches from "@stitches/react";
import { modifyVariantsForStory } from "../../../.storybook/type-utils";
import { styled } from "../../stitches.config";
const Example = styles("div", {
// ...
});
export default Example;
@ygorluiz
ygorluiz / install-zsh-windows-git-bash.md
Created January 17, 2023 08:09 — forked from fworks/install-zsh-windows-git-bash.md
Zsh / Oh-my-zsh on Windows Git Bash

An guide how to activate Windows 11 Pro for free

Why?

Because you will get some more features like an Bitlocker and host your device as an External Desktop which can be accessed through the internet

Am i also able to switch from any other edition to Pro?

The answer is yes! You can switch from almost any edition to Pro completely for free!

Note for users with unactivated Pro edition

People which already have Pro, but not activated, can skip to this step.

Getting started

What you first need to do is open CMD (Command Prompt) as Administrator using this keyboard key: