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

@mrbar42
mrbar42 / README.md
Last active June 18, 2024 16:43
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.