Skip to content

Instantly share code, notes, and snippets.

View piotrpdev's full-sized avatar
🎷
Listening to Pokémon OSTs

Piotr Płaczek piotrpdev

🎷
Listening to Pokémon OSTs
View GitHub Profile
@piotrpdev
piotrpdev / SCREEN-TEST.COB
Created November 22, 2025 23:30
COBOL SCREEN testing
*****************************************************************
* AUTHOR: PIOTR PLACZEK <PPLACZEK@IBM.COM>
* LICENSE: MIT
* DATE: NOVEMBER 2025
* DESCRIPTION: THIS IS A SIMPLE COBOL PROGRAM DEMONSTRATING THE
* USE OF SCREEN. USE:
* cobc -x --Wall SCREEN-TEST.COB && ./SCREEN-TEST
* TO COMPILE AND RUN THE PROGRAM.
*
*
@piotrpdev
piotrpdev / bash_output.txt
Last active November 22, 2025 19:12
Print a dynamically-sized Christmas tree using Peva (@MarkVeerasingam's programming language)
*
/o\
/o..\
/..o\
/o...o\
/.o..o\
/.oo..oo\
/......o\
/...o..o..\
|||
@piotrpdev
piotrpdev / dedupe_electron_changes.py
Last active August 15, 2024 18:23
De-dupe entries in Electron breaking changes.
#!/usr/bin/env python3
import re
breaking_changes_file_path = "/home/piotrpdev/gsoc/electron/docs/breaking-changes.md"
line_to_stop_parsing_at = "## Planned Breaking API Changes (24.0)"
with open(breaking_changes_file_path, "r") as breaking_changes_file:
breaking_changes_list = []
for line in breaking_changes_file:
@piotrpdev
piotrpdev / bloody_tears.ly
Last active July 3, 2024 16:10
LilyPond test (excerpt from "Bloody Tears")
\version "2.24.3"
\header {
title = "Bloody Tears"
subtitle = "from Castlevania"
composer = "Kenichi Matsubara"
arranger = "Arr. by Piotr Bogdan Płaczek"
source = "Original"
style = "Soundtrack"
@piotrpdev
piotrpdev / expo_plot.py
Created May 24, 2024 15:07
Plot frequency of project supervisors for SETU Computing Expo
import matplotlib.pyplot as plt
import PyPDF2
import re
# open the pdf file
reader = PyPDF2.PdfReader("expo.pdf")
# get number of pages
num_pages = len(reader.pages)
@piotrpdev
piotrpdev / yubikey.sh
Created January 27, 2024 17:49
YubiKey for GPG and SSH in Windows and WSL2
# .sh IS FOR FORMATTING, THIS ISN'T AN ACTUAL SCRIPT
#
# https://github.com/drduh/YubiKey-Guide#using-keys
# https://levelup.gitconnected.com/how-to-use-a-yubikey-in-wsl2-linux-on-windows-96f176518583
# https://jardazivny.medium.com/the-ultimate-guide-to-yubikey-on-wsl2-part-1-dce2ff8d7e45
# https://github.com/PowerShell/Win32-OpenSSH/issues/827
#
# IF USING WSL, USE gpg.exe INSTEAD OF gpg (start kleopatra first?)
# make sure you have gpg4win and (maybe putty) installed
# add kleo shortcut to shell:startup and change to minimized
@piotrpdev
piotrpdev / ds3os.yaml
Last active August 9, 2023 15:19
working attempt at ds3os on k8s
---
apiVersion: v1
kind: Service
metadata:
name: hello-world
spec:
type: NodePort
ports:
- name: dashboard-tcp
port: 50005
@piotrpdev
piotrpdev / uploadToBackblaze.js
Created March 4, 2023 02:16
Upload to Backblaze using Node.js
import fetch from 'node-fetch'
import { createHash } from 'crypto'
import { readFile } from 'fs/promises'
class HTTPResponseError extends Error {
constructor (response) {
super(`HTTP Error Response: ${response.status} ${response.statusText}`)
this.response = response
}
}
function parseHTMLTableElem(tableEl) {
const columns = Array.from(tableEl.querySelectorAll('tr:first-child > td')).map(it=>it.textContent);
const rows = tableEl.querySelectorAll('tr:not(:first-child)');
let categoryIndex = -1;
const days = [ "Monday", "Tuesday", "Wednesday", "Thursday", "Friday" ]
@piotrpdev
piotrpdev / schema.sql
Created September 6, 2022 00:54
Supabase Slack Clone using Discord Auth
-- Replace with below
create table public.users (
id uuid not null primary key, -- UUID from auth.users
username text,
discord_id text,
discord_avatar_url text,
status user_status default 'OFFLINE'::public.user_status
);
-- Replace with below