Skip to content

Instantly share code, notes, and snippets.

View paulozullu's full-sized avatar
🏠
Working from home

Paulo Fabrício paulozullu

🏠
Working from home
View GitHub Profile
@paulozullu
paulozullu / index.tsx
Created May 9, 2025 11:14
Tabelas dinâmicas ReactJS + Material UI
import React from 'react';
import {
Card, CardHeader, CardContent, Grid, Table, TableHead, TableBody, TableRow,
TableCell, Accordion, AccordionSummary, AccordionDetails, Typography, Box
} from '@mui/material';
import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
type TabelaData = {
headers: string[];
rows: string[][];
@paulozullu
paulozullu / config.json
Created June 13, 2024 19:27
powerline-shell
{
"segments": [
"time",
"battery",
"virtual_env",
"username",
"ssh",
"cwd",
"git",
"hg",
@paulozullu
paulozullu / rebase.MD
Last active April 10, 2024 11:54
Git tips

O git rebase é usado para modificar o histórico de commits de uma branch. Ele reorganiza os commits de forma linear, movendo os commits da sua branch atual para o topo da branch de destino. Isso pode ser útil para integrar as mudanças de uma branch para outra de forma mais limpa, reorganizando e simplificando o histórico de commits.

Aqui está um exemplo básico de como usar o git rebase:

  1. Certifique-se de estar na branch que deseja modificar (por exemplo, feature):

    git checkout feature
  2. Atualize sua branch feature com as últimas mudanças da branch de destino (main, por exemplo):

@paulozullu
paulozullu / tips.MD
Created March 4, 2022 11:30
mySQL / phpAdmin

1 - Fix error on importing database

Error message: 3750 Unable to create or change a table without a primary key, when the system variable 'sql_require_primary_key' is set. Add a primary key to the table or unset this variable to avoid this message.

SET @ORIG_SQL_REQUIRE_PRIMARY_KEY = @@SQL_REQUIRE_PRIMARY_KEY;
SET SQL_REQUIRE_PRIMARY_KEY = 0;
@paulozullu
paulozullu / nodeJS.MD
Last active December 7, 2022 01:54
Node.js tips

1 - Default timezone in whole NestJS app

Date.prototype.toJSON = () => {
    return moment(this)
      .tz('America/Sao_Paulo')
      .format('YYYY-MM-DD HH:mm:ss.SSS');
  };

2- Install RabbitMQ locally with docker

@paulozullu
paulozullu / exception-filter.ts
Created November 4, 2021 14:05
NestJS Exceptions Filter
import {
ArgumentsHost,
Catch,
ExceptionFilter,
HttpException,
HttpStatus,
Logger,
} from '@nestjs/common';
@Catch()
const sts = new AWS.STS();
sts.getCallerIdentity({}, function (err, data) {
if (err) {
console.log('Error', err);
} else {
console.log(JSON.stringify({ data }));
}
});
@paulozullu
paulozullu / Fix.MD
Last active February 12, 2025 01:14
DigitalOcean without internet

After almost two weeks since I raised this issue, I was finally able to resolve it. The problem occurred in the first place because different packages got uninstalled somehow when I rebooted. This includes cloud-init, ufw and landscape-common. There is probably more that I haven’t noticed yet. Let’s start with the internet connection, this is how I fixed it:

  • Step 1. I created file “/etc/udev/rules.d/70-persistent-net.rules” and added
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="b2:fe:09:35:6e:57", NAME="eth0"

as I mentioned previously. Note that MAC address used above can be found here: “/etc/netplan/50-cloud-init.yaml”

  • Step 2. Run “sudo reboot” and check that eth0 interface persists by running “ifconfig -a”
@paulozullu
paulozullu / translate.html
Created September 10, 2020 11:55
Google translate
<!DOCTYPE html>
<html lang="en-US">
<head>
<title>
How To Add Google Translate
Button On Your Webpage ?
</title>
</head>
@paulozullu
paulozullu / geos_error.md
Created March 20, 2020 16:00
Teknoloxica

Edit this file: site-packages/django/contrib/gis/geos/libgeos.py Look for the function: geos_version_info And change this line:

ver = geos_version().decode()

With this line:

ver = geos_version().decode().split(' ')[0]