Skip to content

Instantly share code, notes, and snippets.

View slowmove's full-sized avatar

Erik Hoffman slowmove

View GitHub Profile
@birme
birme / hls-repeat.js
Created November 1, 2021 09:31
An endpoint that on-the-fly repeats an HLS VOD
// $ node hls-repeat.js
// Example (2 reps): http://localhost:8000/slate-consuo2.mp4/master.m3u8?r=2
// where r is how many times the VOD to be repeated
const { HLSProxy } = require("@eyevinn/hls-proxy");
const HLSRepeatVod = require("@eyevinn/hls-repeat");
const proxy = new HLSProxy({
originHandler: async () => {
// Origin where the VOD is found
@levelsio
levelsio / git_graph.php
Last active June 5, 2023 03:49
GitHub style graph in PHP + CSS
<style>
.git-graph {
text-align: left;
line-height: 1;
}
.git-graph-row {
clear: both;
text-align: left;
}
.git-graph-cell {
@birme
birme / ingest-aws.js
Last active September 22, 2021 11:44
Watch-folder upload and transcode with AWS MediaConvert
// This gist shows an example of an ingest application based on Eyevinn Ingest Application Framework [1] plugins
// to watch a folder for a new MP4-file and upload and transcode on AWS using AWS MediaConvert.
// Copyright 2021 Jonas Birmé
//
// [1] https://eyevinn.github.io/ingest-application-framework/
const { AwsUploadModule } = require("@eyevinn/iaf-plugin-aws");
const { watch } = require("chokidar");
const { createReadStream } = require("fs");
@megahirt
megahirt / Docker with XDebug.md
Last active March 28, 2025 09:03
Debugging PHP with XDebug v3 inside Docker using VSCode

Debugging PHP with XDebug v3 inside Docker using VSCode

Assumptions / Prerequisites

  • XDebug v3+ inside Docker (e.g. php:7.3-apache Docker image)
  • Running Docker v20.10+
  • VSCode with PHP Debug Extension (Felix Becker)
  • Using Docker Compose for orchestration

Objective

@WebReflection
WebReflection / why-i-use-web-components.md
Last active October 18, 2024 10:55
Why I use web components

Why I use web components

This is some sort of answer to recent posts regarding Web Components, where more than a few misconceptions were delivered as fact.

Let's start by defining what we are talking about.

The Web Components Umbrella

As you can read in the dedicated GitHub page, Web Components is a group of features, where each feature works already by itself, and it doesn't need other features of the group to be already usable, or useful.

@alexcasalboni
alexcasalboni / trigger.sql
Created June 18, 2019 09:56
Amazon Aurora MySQL - Trigger to invoke AWS Lambda
DROP TRIGGER IF EXISTS TR_contacts_on_insert;
DELIMITER ;;
CREATE TRIGGER TR_contacts_on_insert
AFTER INSERT ON Contacts
FOR EACH ROW
BEGIN
SELECT NEW.email , NEW.fullname
INTO @Email , @Fullname;
lambda_async(
'arn:aws:lambda:REGION:ACCOUNT_ID:function:SendEmailWithContact',
@fritschy
fritschy / ffmpeg-one-liners.sh
Last active September 7, 2024 01:27
ffmpeg one-liners
# For all snippets, check documentation for details and settings.
# encode video from a V4L2 device, using specified settings.
# x265 worked somewhat better here and produced less skips (although uses 10x CPU compared to x264)
ffmpeg -f video4linux2 -framerate 30 -input_format mjpeg -video_size 1920x1080 -i /dev/video6 -c:v libx265 -preset ultrafast -c:a none -crf 20 out.mp4
# Convert a raw YUYV422 frame from my USB "microscope" to PNG:
# other valid pixel formats are e.g. rgb24 or yuv420p
ffmpeg -f rawvideo -video_size 2592x1944 -pixel_format yuyv422 -i input_yuyv422_2592x1944.dat -f image2 output.png
@WebReflection
WebReflection / custom-elements-pattern.md
Last active March 26, 2025 23:15
Handy Custom Elements' Patterns

Handy Custom Elements' Patterns

Ricardo Gomez Angel Photo by Ricardo Gomez Angel on Unsplash

This gist is a collection of common patterns I've personally used here and there with Custom Elements.

These patterns are all basic suggestions that could be improved, enriched, readapted, accordingly with your needs.

@JoeyBurzynski
JoeyBurzynski / 55-bytes-of-css.md
Last active April 8, 2025 14:18
58 bytes of css to look great nearly everywhere

58 bytes of CSS to look great nearly everywhere

When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:

main {
  max-width: 38rem;
  padding: 2rem;
  margin: auto;
}
@qoomon
qoomon / conventional-commits-cheatsheet.md
Last active April 14, 2025 10:12
Conventional Commits Cheatsheet

Conventional Commit Messages starline

See how a minor change to your commit message style can make a difference.

Tip

Take a look at git-conventional-commits , a CLI util to ensure these conventions, determine version and generate changelogs

Commit Message Formats

Default