Skip to content

Instantly share code, notes, and snippets.

View brunos3d's full-sized avatar
:shipit:
hunting bytes 🏹

Bruno Silva brunos3d

:shipit:
hunting bytes 🏹
View GitHub Profile
@mjbalcueva
mjbalcueva / password-input.tsx
Last active May 6, 2025 01:20
shadcn ui custom password input
'use client'
import * as React from 'react'
import { EyeIcon, EyeOffIcon } from 'lucide-react'
import { Button } from '@/components/ui/button'
import { Input, type InputProps } from '@/components/ui/input'
import { cn } from '@/lib/utils'
const PasswordInput = React.forwardRef<HTMLInputElement, InputProps>(({ className, ...props }, ref) => {
@lacolaco
lacolaco / 1.ngx-reactify.tsx
Last active September 11, 2024 09:51
A React component to render a standalone Angular component (Angular v14.2 is required)
import { ApplicationRef, ComponentRef, createComponent, Type } from "@angular/core";
import { createApplication } from "@angular/platform-browser";
import React, { useEffect, useRef, useState } from "react";
type AnyComponentRef = ComponentRef<unknown>;
export type ReactifyProps = {
component: Type<unknown>;
inputs?: Record<string, unknown>;
};
/*
{
"compilerOptions": {
"baseUrl": ".",
"outDir": "build/dist",
"module": "esnext",
"target": "es6",
"lib": [
"es2019",
"dom",
@mukaschultze
mukaschultze / arch.md
Last active February 18, 2025 14:20
Free Arch Linux on GCP
@mukaschultze
mukaschultze / loopback_bind.md
Last active January 2, 2025 00:30
Acessando serviços no docker sem expor as portas publicamente

Acessando serviços no docker sem expor as portas publicamente

Expondo portas apenas no loopback

Com Docker é possível configurar um container para que ele ouça conexões à uma porta apenas em um IP por meio da opção publish, no formato ip:hostPort:containerPort. Isso impede que conexões sejam feitas por outros IPs sejam aceitas.

Se configurarmos o container para ouvir apenas no IP de loopback (127.0.0.1),

@jordienr
jordienr / Gradient.js
Created September 12, 2021 00:23
Stripe Mesh Gradient WebGL
/*
* Stripe WebGl Gradient Animation
* All Credits to Stripe.com
* ScrollObserver functionality to disable animation when not scrolled into view has been disabled and
* commented out for now.
* https://kevinhufnagl.com
*/
@mukaschultze
mukaschultze / rxjs-hooks.ts
Created September 5, 2021 19:39
RxJS hooks for React
import { useEffect, useRef, useState } from "react";
import { BehaviorSubject, Observable, PartialObserver, Subject } from "rxjs";
function useConstant<T>(factory: () => T): T {
const ref = useRef<{ value: T }>();
if (!ref.current) {
ref.current = { value: factory() };
}
  1. Install @module-federation/nextjs-mf.
yarn add @module-federation/nextjs-mf
  1. Add resolutions to package.json:
  "resolutions": {
@Froelund
Froelund / _error.tsx
Last active November 30, 2023 04:35
Next.js Typescript error reporting
import { captureException, flush } from '@sentry/nextjs';
import NextErrorComponent from 'next/error';
import type { ErrorProps } from 'next/error';
import type { NextPage } from 'next';
interface AppErrorProps extends ErrorProps {
err?: Error;
hasGetInitialPropsRun?: boolean;
}

Artigo Metodologia de Pesquisa em SI

Título

Relato de desenvolvimento de emulador NES usando Rust Relato do uso da linguagem Rust no desenvolvimento de um emulador de NES

Autores

Samuel M. Schultze [email protected]

Manual de estilo