Skip to content

Instantly share code, notes, and snippets.

const audio = new Audio('https://url-to-my.audio');
// Play
audio.play();
// Pause
audio.pause();
// Stop
audio.pause();
@prinx
prinx / gist:778e07eceaff25c6ac19783e930721e8
Created April 16, 2021 17:33
Install PHP Composer 2 package without internet
# Install Composer package without internet
With Composer 2, you can install a package without internet, provided that you've installed the same package before and it has been cached by composer.
To install the package without internet, we need to set an environment variable to let composer know we want to work without internet.
In the terminal:
```shell
export COMPOSER_DISABLE_NETWORK=1
@prinx
prinx / use-mailhog-for-email-on-localhost.md
Last active June 15, 2021 03:41
Using MailHog for email testing on localhost
  1. Go to https://github.com/mailhog/MailHog/releases and download the release matching your system.
  2. Install the downloaded package
  3. Send email specifying the SMTP server as localhost and the SMTP port as 1025.
  4. Access the dashboard at localhost:8025 to see your sent email.
@prinx
prinx / Install Redis on Windows 10, PHP 7+
Created July 16, 2021 20:29 — forked from ezequiel9/Install Redis on Windows 10, PHP 7+
Install Redis on Windows 10, PHP 7+
Install Redis extension on your pc
Download the CORRECT version the DDL from the following link
https://pecl.php.net/package/redis/4.1.0/windows
Put the dll in the correct folder
Wamp -> C:\wamp\bin\php\php-XXXX\ext
Laragon -> C:\laragon\bin\php\php-XXX\ext
Edit the php.ini file adding

Configuring OpenEdx Tutor on my local machine, on another port (85), with Nginx as a reverse proxy

Install (docs)

pip install "tutor[full]"

Set the port

OpenEdX deployment with Traefik as reverse proxy

Author: Prince Dorcis

  • This assumes you already have a working installation of Traefik, with an external network named traefik.
  • This assumes Docker and Docker Compose are installed.
  • OS: Ubuntu 24 (But everything here can be easily adapted to other OSs).
  • Tutor version: 17.0.5

Install tutor

@prinx
prinx / 3d-progress-bar.markdown
Created September 1, 2024 14:13
3D Progress bar
@prinx
prinx / commands.md
Last active April 14, 2025 06:14
List of my commands

Commands

How do I add a custom thumbnail to a .mp4 file using ffmpeg Link

ffmpeg -i video.mp4 -i image.png -map 1 -map 0 -c copy -disposition:0 attached_pic out.mp4

Reducing filesize of video in Linux Link