Skip to content

Instantly share code, notes, and snippets.

View Potherca's full-sized avatar
🤔
I wonder what this button does…

Ben Peachey Potherca

🤔
I wonder what this button does…
View GitHub Profile
@Potherca
Potherca / solutions-stacks.csv
Last active May 20, 2024 19:57
Solution Stack Acronyms
Stack Name Stack Type Operating System / Platform Server Database Language or SDK Framework UI Message Bus / Queue
AMP Web (Backend) Apache MySQL / MariaDB Perl / PHP / Python
BAMP Web (Backend) BSD Apache MySQL / MariaDB Perl / PHP / Python
BAPP Web (Backend) BSD Apache PostgreSQL Perl / PHP / Python
BCHS Web (Backend) BSD SQLite httpd C
DAMP Web (Backend) Darwin Apache MySQL / MariaDB Perl / PHP / Python
ELK Time Series Data Logstash Elasticsearch Kibana
ELKB Time Series Data Logstash Elasticsearch Beats Kibana
FAMP Web (Backend) FreeBSD Apache MySQL / MariaDB Perl / PHP / Python
FWAP Web (Backend) Windows Apache Firebird Perl / PHP / Python
@Potherca
Potherca / compile-lynx-wasm.sh
Last active April 13, 2024 16:05
Steps to compile the Lynx web browser to Web Assembly
# Sources used in figuring this out:
#
# - https://developer.mozilla.org/en-US/docs/WebAssembly/C_to_wasm
# - https://emscripten.org/docs/compiling/Building-Projects.html#building-projects
# Set up Emscripten SDK
git clone https://github.com/emscripten-core/emsdk.git
cd emsdk/
./emsdk install latest
./emsdk activate latest
@Potherca
Potherca / README.md
Last active April 8, 2024 10:16
BASH script to clone all git repository in a Group on GitLab, or Organization on GitHub.

Introduction

Starting at a new employer always mean checking out various git repositories.

As the amount of repositories a company has grows, the time needed to clone all of those repositories also grows.

This script automates this task.

In order for this script to work, a personal access token is needed.

@Potherca
Potherca / pico8.desktop
Created August 23, 2022 16:28
File to add Pico 8 as a menu item on Linux
# ~/.local/share/applications/pico8.desktop
[Desktop Entry]
Name=Pico8
Comment=Fantasy console for making, sharing and playing tiny games and other computer programs.
GenericName=Fantasy Console
X-GNOME-FullName=Pico-8
Exec=/usr/local/bin/pico8
Terminal=false
Type=Application
Icon=/usr/local/lib/pico-8/lexaloffle-pico8.png
@Potherca
Potherca / README.md
Last active March 4, 2024 23:40
The search for a Regex to match BEM CSS class-names

The search for a Regex to match BEM CSS class-names

TL;DR

Use this regular expression to match BEM class-names:

^\.[a-z]([a-z0-9-]+)?(__([a-z0-9]+-?)+)?(--([a-z0-9]+-?)+){0,2}$
@Potherca
Potherca / README.md
Last active February 28, 2024 19:17
What is the use of the hackers.txt file? (Or a history of security.txt)

(This article was originally posted as an answer to a question on stackoverflow)

Commonly known as Eduardo Vela, [Eduardo A. Vela Nava][1] (or sirdarckcat on [Github][2] and [Twitter][3]) has been a Security Engineer at Google since 2010. (He currently has the role of Product Security Response Team Lead).

As other security experts before him, he pondered the issue of effectively communicating the details of a site's vulnerability reward program to [white hat hackers][4]/[pen-testers][5].

One specific such person is [Chema Alonso][6] (also on [Twitter][7]).

He is well-known enough to warrant [a Spanish Wikipedia entry][8]

Creating a real UUIDv4 in JS usually requires a library. The new https://developer.mozilla.org/en-US/docs/Web/API/Crypto/randomUUID can be used in the browser.

But how hard is it to create a valid UUIDv4? As it turns out, not very!

The following is all that is needed for a version 4 UUID (including correctly setting the so called M and N bits):

const generateUUID = () => "10000000-1000-4000-8000-100000000000".replace(/[018]/g, s => (s ^ Math.random() * 256 & 15 >> s / 4).toString(16));

This can be seen in action at https://gist.pother.ca/4a2b95623519e74b63d9485a4311ac3c

@Potherca
Potherca / dabblet.css
Last active February 18, 2024 15:55
Can `!important` be used as an ID or class? YES IT CAN! HTML5LOLZFTW! https://dabblet.com/gist/3a1bcdb58326128f0a13b1424f14a7f4
/**
* Can `!important` be used as an ID or class? YES IT CAN! HTML5LOLZFTW!
*
* Visit either:
* - https://gist.github.com/Potherca/3a1bcdb58326128f0a13b1424f14a7f4
* - http://dabblet.com/gist/3a1bcdb58326128f0a13b1424f14a7f4
*/
div {
color: lime !important;