Skip to content

Instantly share code, notes, and snippets.

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

Vitor Britto vitorbritto

🏠
Working from home
View GitHub Profile
@vitorbritto
vitorbritto / rm_mysql.md
Last active April 23, 2024 14:21
Remove MySQL completely from Mac OSX

Remove MySQL completely

  1. Open the Terminal

  2. Use mysqldump to backup your databases

  3. Check for MySQL processes with: ps -ax | grep mysql

  4. Stop and kill any MySQL processes

  5. Analyze MySQL on HomeBrew:

    brew remove mysql
    
@vitorbritto
vitorbritto / regex.md
Last active March 14, 2024 03:14
Regex Cheat Sheet

Regular Expressions

Basic Syntax

  • /.../: Start and end regex delimiters
  • |: Alternation
  • (): Grouping
@vitorbritto
vitorbritto / devlist-bookmarks.md
Last active October 10, 2023 13:49
A BADASS list for faster Web Development! Recently, I decided to organize my bookmarks. So, like a good fellow, I am sharing with you. I hope you enjoy!

Dev List Bookmarks

Attention: the list was moved to https://github.com/vitorbritto/dev-list

This page is not maintained anymore, please update your bookmarks.


Recently, I decided to organize my bookmarks. So, like a good fellow, I am sharing with you. I hope you enjoy!

@vitorbritto
vitorbritto / bash_alias
Last active August 30, 2023 09:03
dotfiles - bash alias
#!/bin/bash
# ------------------------------------------------------------------------------
# | System |
# ------------------------------------------------------------------------------
# Navigation
# -------------------
<ErrorBoundary>
<MyComponent />
</ErrorBoundary>
@vitorbritto
vitorbritto / ErrorBoundary.tsx
Created May 14, 2023 19:02
Source Error Boundary
class ErrorBoundary extends React.Component {
constructor(props) {
super(props);
this.state = { hasError: false };
}
static getDerivedStateFromError(error) {
// Update state so the next render will show the fallback UI.
return { hasError: true };
@vitorbritto
vitorbritto / index.ts
Last active May 14, 2023 19:00
React Error Boundary - App
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import * as serviceWorker from './serviceWorker';
import { AppError } from './components/AppError';
ReactDOM.render(
<React.StrictMode>
<AppError>
@vitorbritto
vitorbritto / AppError.tsx
Last active May 14, 2023 18:59
React Error Boundary
import { Component } from 'react';
const ErrorComponent = () => {
return <h1>Something went wrong</h1>;
};
export class AppError extends Component {
state = {
hasError: false,
};
@vitorbritto
vitorbritto / vim.md
Last active January 20, 2023 09:26
Vim Commands Cheat Sheet

Vim Commands Cheat Sheet

How to Exit

Command Description
:q[uit] Quit Vim. This fails when changes have been made.
:q[uit]! Quit without writing.
:cq[uit] Quit always, without writing.