Skip to content

Instantly share code, notes, and snippets.

View astrolox's full-sized avatar
😎
Improving the Internet - Got a question?

Brian Wojtczak astrolox

😎
Improving the Internet - Got a question?
View GitHub Profile
@astrolox
astrolox / html2md.go
Created April 8, 2024 18:35
Basic HTML to Markdown convertor for CLI use
package main
import (
"github.com/JohannesKaufmann/html-to-markdown"
"io"
"log"
"os"
"strings"
)
@astrolox
astrolox / jwt.php
Created June 4, 2021 14:09
PHP 5.1 RS256 JWT
<?php
// Written for PHP 5.1 without openssl
// phpseclib version 1.0.19 (PHP 4 compatible)
// http://sourceforge.net/projects/phpseclib/files/phpseclib1.0.19.zip/download
// https://github.com/phpseclib/phpseclib
include 'Crypt/Hash.php';
include 'Crypt/RSA.php';
@astrolox
astrolox / bad_performance_test.sh
Created July 6, 2020 11:00
Demonstration of naive and incorrect way to compare web performance.
#!/usr/bin/env bash
# This script demonstrates a naive and incorrect way to compare the
# performance of HTTP, HTTPS (HTTP/1.1), and HTTPS (HTTP/2).
# This is incorrect because:
# 1. the HTTP response is just a 302, not a full page.
# 2. each request is just for the initial page html and
# not all of the resources required to render the full page.
# 2. each and every HTTPS request is a completely new
@astrolox
astrolox / LICENSE
Last active April 5, 2024 03:08
Implementing Socket IO event handling via Blueprint in Flask-SocketIO - without using a single global socketio object.
Copyright 2020 Brian Wojtczak
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
FROM php:7.0-apache
# Enable rewrite
RUN a2enmod rewrite
# Enable php extensions
RUN apt-get update && apt-get install -y \
libfreetype6-dev \
libjpeg62-turbo-dev \
libmcrypt-dev \

Keybase proof

I hereby claim:

  • I am astrolox on github.
  • I am astrolox (https://keybase.io/astrolox) on keybase.
  • I have a public key ASCl0dRpKBCMiFNJaZ-Kq_8F-4R97DBotmY2GAWIXPqm1Ao

To claim this, I am signing this object: