Skip to content

Instantly share code, notes, and snippets.

View nicholasyoannou's full-sized avatar
:octocat:

Nicholas Y. nicholasyoannou

:octocat:
View GitHub Profile
@1oonie
1oonie / message_components.md
Last active March 30, 2024 18:22
Message components

Message components

This gist shows you how to use message components in discord.py 2.0

This assumes that you know how Object Orientated Programming in Python works, if you don't know what this is then I recommend that you read this guide.

Installing

You'll need to install discord.py from git to use this (if you don't have git then google how to install it for your OS, I can't be bothered to put it in here...), if you already have this then you can skip to the next section. However if you don't please read the below

@FinnWoelm
FinnWoelm / read-text-message.sh
Created December 27, 2019 14:01
How to read text messages from USB modem
# Full instructions: http://manpages.ubuntu.com/manpages/bionic/en/man8/mmcli.8.html
# Examples: http://manpages.ubuntu.com/manpages/bionic/en/man8/mmcli.8.html#examples
# Supported modems: https://www.freedesktop.org/wiki/Software/ModemManager/SupportedDevices/
# Get list of connected modems.
mmcli --list-modems
# Output:
# Found 1 modems:
# /org/freedesktop/ModemManager1/Modem/1 [huawei] E3531
# The number at the end of the path is the modem index.
@mrbar42
mrbar42 / README.md
Last active October 25, 2024 19:35
Secured HLS setup with Nginx as media server

Secured HLS setup with Nginx as media server

This example is part of this article.

This is an example for an HLS delivery with basic security. Nginx compiled with nginx-rtmp-module & secure-link is used as media server. Features:

  • Domain filtering
  • Referrer filtering
  • Embed buster

Direct copy of pre-encoded file:

$ ffmpeg -i filename.mp4 -codec: copy -start_number 0 -hls_time 10 -hls_list_size 0 -f hls filename.m3u8

@rca
rca / iso2unix.py
Created September 11, 2012 21:08
Convert an ISO 8601 timestamp to unix timestamp
import calendar
from iso8601 import parse_date
def iso2unix(timestamp):
"""
Convert a UTC timestamp formatted in ISO 8601 into a UNIX timestamp
"""
# use iso8601.parse_date to convert the timestamp into a datetime object.