Skip to content

Instantly share code, notes, and snippets.

View resetius's full-sized avatar

Alexey Ozeritskiy resetius

View GitHub Profile
@cesarmiquel
cesarmiquel / process-vga-pallette.php
Created April 16, 2020 04:39
VGA 256 Color Palette to RGB
<?php
$im = imagecreatefrompng("vga-palette.png");
$sx = (int) 800 / 16;
$sy = (int) 800 / 16;
$ox = (int) ($sx / 2);
$oy = (int) ($sx / 2);
for($y = 0; $y < 16; $y++) {
for($x = 0; $x < 16; $x++) {
$rgb = imagecolorat($im, $sx*$x + $ox, $sy*$y + $oy);
@darrenjs
darrenjs / ssl_server_nonblock.c
Last active March 22, 2024 08:34
OpenSSL example using memory BIO with non-blocking socket IO
/*
This file had now been added to the git repo
https://github.com/darrenjs/openssl_examples
... which also includes a non blocking client example.
-------------------------------------------------------------------------------
ssl_server_nonblock.c -- Copyright 2017 Darren Smith -- MIT license