Skip to content

Instantly share code, notes, and snippets.

View djalilhebal's full-sized avatar
💜
Making the impossible possible

Abdeldjalil Hebal djalilhebal

💜
Making the impossible possible
View GitHub Profile
@djalilhebal
djalilhebal / playwright-test-2023-10-25.js
Last active October 25, 2023 22:02
Playwright test: Simulating basic interactions between two agents (Alice and Bob) through a real time web app (Local Party, think of it as the Server agent).
/**
* @file
* Simulating basic interactions between two agents (Alice and Bob) through
* a real time web app (Local Party, think of it as the Server agent).
*
* Notes:
* - I couldn't test it on my own web app (Peer Party is bugged ATM),
* so I had to test it on a similar website.
* - My ultimate goal is to do basic BDD (or E2E testing) for my PP.
* - Tested with Playwright v1.39 using previously installed browsers: Edge and Chrome.
@djalilhebal
djalilhebal / 2020-12_01_disappear-dlink.md
Created December 10, 2020 20:16
A Shell script to enable and disable the Wi-Fi / Virtual Access Points via Telnet
@djalilhebal
djalilhebal / ffmpeg-hated-by-life-itself.sh
Last active October 9, 2022 21:48
Video editing using Bash and ffmpeg to cut, concat, and create dynamic text overlays (SVG)
#!/bin/bash
###
## @file FFmpeg - Hated By Life Itself
## @date 2020-10-30
## @author Abdeldjalil Hebal (@djalilhebal)
## @license WTFPL
##
## @description Video editing using Bash and ffmpeg to cut, concat, and create dynamic text overlays (SVG).
##
## This is the best I can do with my current "video editing skills":
@djalilhebal
djalilhebal / toMagnetURI.js
Created August 3, 2020 08:47
A JavaScript function that converts a BitTorrent info-hash to a magnet URI with "the best public trackers"
/**
* Convert a BitTorrent info-hash to a magnet URI that contains "the best public trackers"
* @see https://en.wikipedia.org/wiki/Magnet_URI_scheme
* @see https://github.com/ngosang/trackerslist
* @example
* toMagnetURI({hash: '286d2e5b4f8369855328336ac1263ae02a7a60d5', name: 'Ubuntu 18.04 x64'});
* // returns a magnet link for http://releases.ubuntu.com/18.04/ubuntu-18.04.4-desktop-amd64.iso.torrent
*
* @param {({hash: string, name?: string})} info
* @returns {string} magnet uri
@djalilhebal
djalilhebal / masmo-dosemu.js
Created July 24, 2020 22:18
A programmatic interface for Node that wraps MASM and LINK using DOSEMU
/**
* masmo-dosemu.js
*
* @fileoverview A programmatic interface that wraps MASM and LINK using DOSEMU.
* It uses DOSEMU in the `-dumb` mode to be able to interact with it through the `stdin` and `stdout` streams.
* Currenty it only parses errors and warning that are causes by a provided code (the `lint` method).
* Also, it currently works only on Linux.
*
* This is basically a test of Node Steams and a "proof of concept" of last year's idea Masmo.js (which I should rename to `masmo-v86`):
* - See https://github.com/djalilhebal/trash/blob/master/2019-04/Masmo.js
@djalilhebal
djalilhebal / dduck.js
Last active October 30, 2020 19:52
A dull downloader for "The Duck Comics"
/**
* @file dduck.js -- A dull downloader for "The Duck Comics"
* @author djalilhebal
* @date 2018-05-08
*
* Remember Hatem's Heaven? Well, this should be named Hatem's Hell :")
* It sorta sucks:
* - Experimental stuff: Promises, async/await, save/load
* - it should save each comic in a separate folder, but it just saves everything in the cwd
* - it should depend only on nodejs packages but it still relies on the CLI utility 'aria2c'