Skip to content

Instantly share code, notes, and snippets.

View pedrohenriquebr's full-sized avatar
💻
Home office

Pedro Braga pedrohenriquebr

💻
Home office
  • Rio de Janeiro, Brazil
View GitHub Profile
@pedrohenriquebr
pedrohenriquebr / dom_casmurro.txt
Last active October 14, 2025 20:29
Teste Markov
DOM CASMURRO
POR
MACHADO DE ASSIS
DA ACADEMIA BRAZILEIRA
H. GARNIER, LIVREIRO-EDITOR
@pedrohenriquebr
pedrohenriquebr / main.py
Last active April 18, 2025 18:18
Webscrapper for linkedin
# ==============================================================================
# Necessary Imports
# ==============================================================================
import asyncio
import hashlib
import os
import time as tm # For scraper delays
import json # To load config if needed in the future
from typing import List, Optional, Dict, Any, Set, Tuple
from urllib.parse import quote, urlencode
@pedrohenriquebr
pedrohenriquebr / extension.ts
Last active April 8, 2023 15:10
JarvisGPT Extension preview
// The module 'vscode' contains the VS Code extensibility API
// Import the module and reference it with the alias vscode in your code below
import * as vscode from 'vscode';
import axios from 'axios';
import {prompts} from './prompts';
export const PROMPTS_ENUM : {[key:string] : string} = {
'jarvisgpt.refactor' : prompts.REFACTOR_PROMPT,
'jarvisgpt.explain': prompts.EXPLAIN_PROMPT,
'jarvisgpt.doc': prompts.DOC_PROMPT,
@pedrohenriquebr
pedrohenriquebr / ValueConverters.cs
Last active December 6, 2022 17:34
PayloadConverter - used for value conversions
public class PayloadConverter<T>: ValueConverter<T, string>
{
public PayloadConverter()
: base(from => JsonSerializer.Serialize(from, (JsonSerializerOptions) null),
to => JsonSerializer.Deserialize<T>(to, (JsonSerializerOptions) null))
{
}
}
@pedrohenriquebr
pedrohenriquebr / ReflectionExtensions.cs
Last active September 11, 2022 21:43
Extensions Methods for casting base class to derived class for inheritance object mappers
namespace Reflection.Extensions;
public static class ReflectionExtensions
{
public static object? GetPropertyValue(object obj, string propertyName)
{
var propertyInfo = obj.GetType().GetProperty(propertyName);
return propertyInfo?.GetValue(obj);
@pedrohenriquebr
pedrohenriquebr / migration.py
Created February 10, 2022 14:04
migrate angular material 8 to angular material 9
import re
regex = r"(import \{ )?((\w+)[, ]+)(?=.*?(\} from '(@angular\/material)'))"
'''
Put this script in root dir of your angular project
Execute from terminal: python migration.py
'''
# dict MatModule to lib inside @angular/material/name
dict = {
'MatAutocompleteModule': 'autocomplete',
'MatButtonModule': 'button',
@pedrohenriquebr
pedrohenriquebr / main.py
Last active August 15, 2021 14:44
BLACK SCREEN WITH OPENCHV
import argparse
import os
import cv2
import numpy as np
BUILD_DIR = './build'
VERSION = '0.5'
if __name__ == "__main__":
@pedrohenriquebr
pedrohenriquebr / index.css
Created June 7, 2021 02:00
Nav Footer bar with effect
:root {
--primary: rgb(1, 1, 133);
}
*,*::after, *::before{
margin:0;
padding: 0;
box-sizing: border-box;
}
@pedrohenriquebr
pedrohenriquebr / index.js
Last active April 11, 2020 01:38
CSS Loader + React JS implementation
import React, { Component } from 'react';
import api from '../../services/api';
import './styles.css';
import './loader.css';
export default class TodoItem extends Component {
state = {
todoitem: {},
loading: true,
@pedrohenriquebr
pedrohenriquebr / index.css
Last active April 5, 2020 00:46
Calendário CSS Grid + Flexbox
.calendar {
display: grid;
grid-template-columns: auto;
grid-template-rows: 1fr 16fr;
align-items: center;
justify-content: center;
grid-gap: 0em;
}
html {