Skip to content

Instantly share code, notes, and snippets.

@Ilgrim
Ilgrim / rss.php
Created June 21, 2023 12:25 — forked from bossman759/rss.php
Parse RSS(XML) in php!
$html = "";
// URL containing rss feed
$url = "http://www.realbeta.net63.net/blog/rss?id=1";
$xml = simplexml_load_file($url);
for($i = 0; $i < 1; $i++){
$title = $xml->channel->item[$i]->title;
$link = $xml->channel->item[$i]->link;
$description = $xml->channel->item[$i]->description;
$pubDate = $xml->channel->item[$i]->pubDate;
@Ilgrim
Ilgrim / starttls_smtp_example.go
Created June 14, 2023 19:52 — forked from jim3ma/starttls_smtp_example.go
Golang StartTLS SMTP Example
package main
import (
"fmt"
"log"
"net"
"net/mail"
"net/smtp"
"crypto/tls"
)
@Ilgrim
Ilgrim / golang-tls.md
Created June 14, 2023 19:51 — forked from denji/golang-tls.md
Simple Golang HTTPS/TLS Examples

Moved to git repository: https://github.com/denji/golang-tls

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