Skip to content

Instantly share code, notes, and snippets.

View gphg's full-sized avatar

Garett PHG gphg

  • NKRI
  • 21:54 (UTC +07:00)
View GitHub Profile
@gphg
gphg / Scheduler.lua
Created December 4, 2023 07:48 — forked from saga/Scheduler.lua
Lua Coroutine Scheduler
pcall(require,"socket")
Scheduler = setmetatable({}, {
__call = function(class)
return setmetatable({
threads = {},
}, class)
end
})
Scheduler.__index = Scheduler
@gphg
gphg / makegifs.py
Last active December 27, 2022 18:13 — forked from Zulko/makegifs.py
My own custom of makegifs.py.
#!/usr/bin/env python
# Taken from http://zulko.github.io/blog/2015/02/01/extracting-perfectly-looping-gifs-from-videos-with-python-and-moviepy/
import os
import sys
import moviepy.editor as mp
from moviepy.video.tools.cuts import FramesMatches
# Extends FramesMatches, the code is copied from source file then modified
@gphg
gphg / mp42gif.sh
Last active June 5, 2022 18:56 — forked from troyane/mp42gif.sh
See script and documentation here: https://github.com/troyane/StackOverflow-pro/tree/master/mp42gif Script to convert MP4 file to GIF (via ffmpeg). It creates intermediate custom color palette out of input video file and use it for resulting GIF for better picture quality. For more info see https://superuser.com/a/556031
#!/bin/bash
#
# Script to convert MP4 video to GIF with generation of custom color palette.
#
#=== Do not touch code below
# Inner variables
input_file=""
input_fps=""
input_height=""
@gphg
gphg / PicoPageModPlugin.php
Last active July 13, 2020 01:53 — forked from PhrozenByte/PicoPageModPlugin.php
A simple Pico plugin adding a page's last modification time to its page data. Pico is a stupidly simple, blazing fast, flat file CMS. http://picocms.org/
<?php
/**
* Pico page modification time plugin
*
* Adds a page's last modification time to its page data.
*
* Example:
*
* ```twig