Skip to content

Instantly share code, notes, and snippets.

@Ilgrim
Ilgrim / golang-tls.md
Created June 14, 2023 19:51 — forked from denji/golang-tls.md
Simple Golang HTTPS/TLS Examples
Generate private key (.key)
# Key considerations for algorithm "RSA" ≥ 2048-bit
openssl genrsa -out server.key 2048

# Key considerations for algorithm "ECDSA" ≥ secp384r1
# List ECDSA the supported curves (openssl ecparam -list_curves)
@Ilgrim
Ilgrim / main.cpp
Created May 28, 2023 22:44 — forked from adituv/main.cpp
SDL Gamepad Input Stuff
#include <cstdio>
#include <string>
#include <vector>
#include <SDL.h>
void logJoystickEvent(SDL_Event e);
std::string showHatState(Uint8 hat);
int main(int argc, char* argv[]) {
// Detect first gamepad on which a key is pressed, then log its events.
@Ilgrim
Ilgrim / ISA.txt
Created May 21, 2023 18:11 — forked from PhirePhly/ISA.txt
Intro to the ISA bus by Mark Sokos
THE ISA AND PC/104 BUS
IBM, IBM/XT, IBM PC, and IBM PC AT are registered trademarks of
International Business Machines Corporation.
This file is designed to give a basic overview of the bus found in
most IBM clone computers, often referred to as the XT or AT bus. The
AT version of the bus is upwardly compatible, which means that cards
@Ilgrim
Ilgrim / perlin.c
Created May 11, 2023 22:46 — forked from nowl/perlin.c
Perlin Noise in C
#include <stdio.h>
static int SEED = 0;
static int hash[] = {208,34,231,213,32,248,233,56,161,78,24,140,71,48,140,254,245,255,247,247,40,
185,248,251,245,28,124,204,204,76,36,1,107,28,234,163,202,224,245,128,167,204,
9,92,217,54,239,174,173,102,193,189,190,121,100,108,167,44,43,77,180,204,8,81,
70,223,11,38,24,254,210,210,177,32,81,195,243,125,8,169,112,32,97,53,195,13,
203,9,47,104,125,117,114,124,165,203,181,235,193,206,70,180,174,0,167,181,41,
164,30,116,127,198,245,146,87,224,149,206,57,4,192,210,65,210,129,240,178,105,
@Ilgrim
Ilgrim / makefile
Created May 5, 2023 21:12 — forked from MarcosX/makefile
Simple SDL makefile
# Directories
S_DIR=source
B_DIR=build
# Files
S_FILES=$(S_DIR)/sdl_test.cpp
# Output
EXEC=$(B_DIR)/sdl_app
/*
* A function for toggling windowed mode in a C++ SDL app. Fullscreen windows will appear on whichever screen the window was on.
*
* Could be used in conjunction with SDL_GetDisplayName(int displayIndex)
* and SDL_GetNumVideoDisplays(void) to programmatically force fullscreen onto a particular display
*/
void toggleWindowed()
{
//Grab the mouse so that we don't end up with unexpected movement when the dimensions/position of the window changes.
@Ilgrim
Ilgrim / CMakeLists.txt
Created March 26, 2023 16:55 — forked from Lightnet/CMakeLists.txt
SDL 2 Project build test.
#================================================
# CMAKE BUILD
# WINDOW BUILD CURRENTLY
#================================================
cmake_minimum_required(VERSION 3.20) # FetchContent is available in 3.11+
message("CMAKE_BUILD_TYPE >>> " ${CMAKE_BUILD_TYPE})
#convert checks for deubug / release
string(TOLOWER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE)
if(CMAKE_BUILD_TYPE STREQUAL "debug")
@Ilgrim
Ilgrim / gitlab-api.ps1
Created February 22, 2023 23:48 — forked from nobusugi246/gitlab-api.ps1
GitLab API with PowerShell.
# https://docs.gitlab.com/ee/api/projects.html
# https://docs.gitlab.com/ee/api/issues.html
# https://docs.gitlab.com/ee/api/notes.html
# Project List
$r = Invoke-RestMethod -Headers @{ 'PRIVATE-TOKEN'='xxxxx' } -Uri http://xxxxx/api/v4/projects/
$r | Sort-Object -Property id | Format-Table -Property id, name
# Issues List
$r = Invoke-RestMethod -Headers @{ 'PRIVATE-TOKEN'='xxxxx' } -Uri http://xxxxx/api/v4/projects/<xx>/issues
@Ilgrim
Ilgrim / perlbot.pl
Created September 25, 2022 23:20 — forked from bssanchez/perlbot.pl
IRC bot in perl
#!/usr/bin/perl
use strict;
use IO::Socket;
################################################################
# Prueba perl de botIRC #
# Objetivo del proyecto aprender manejo de perl con algunas #
# de sus funciones y sobre todo sockets xD... #
# #
@Ilgrim
Ilgrim / irc.bot.0.1.py
Created September 23, 2022 11:24 — forked from 11fl/irc.bot.0.1.py
IRC bot python 3
# -*- coding: utf-8 -*-
import socket
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
HOST = '' #irc server
PORT = 6665 #port
NICK = 'pony_bot'
USERNAME = 'megadeath'
REALNAME = 'little pony'