Skip to content

Instantly share code, notes, and snippets.

View brunos3d's full-sized avatar
📜
<script>alert('Hello, World!')</script>

Bruno Silva brunos3d

📜
<script>alert('Hello, World!')</script>
View GitHub Profile
@lacolaco
lacolaco / 1.ngx-reactify.tsx
Last active February 26, 2024 08:13
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>;
};
@mukaschultze
mukaschultze / arch.md
Last active March 6, 2022 01:50
Free Arch Linux on GCP
@mukaschultze
mukaschultze / loopback_bind.md
Last active August 29, 2023 04:57
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 samuelschultze@gmail.com

Manual de estilo

" Specify a directory for plugins
call plug#begin('~/.vim/plugged')
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'scrooloose/nerdtree'
"Plug 'tsony-tsonev/nerdtree-git-plugin'
Plug 'Xuyuanp/nerdtree-git-plugin'
Plug 'tiagofumo/vim-nerdtree-syntax-highlight'
Plug 'ryanoasis/vim-devicons'
Plug 'airblade/vim-gitgutter'
@coltenkrauter
coltenkrauter / fix-wsl2-dns-resolution
Last active June 24, 2024 19:16
Fix DNS resolution in WSL2
More recent resolution:
1. cd ~/../../etc (go to etc folder in WSL).
2. echo "[network]" | sudo tee wsl.conf (Create wsl.conf file and add the first line).
3. echo "generateResolvConf = false" | sudo tee -a wsl.conf (Append wsl.conf the next line).
4. wsl --terminate Debian (Terminate WSL in Windows cmd, in case is Ubuntu not Debian).
5. cd ~/../../etc (go to etc folder in WSL).
6. sudo rm -Rf resolv.conf (Delete the resolv.conf file).
7. In windows cmd, ps or terminal with the vpn connected do: Get-NetIPInterface or ipconfig /all for get the dns primary and
secondary.