Skip to content

Instantly share code, notes, and snippets.

View gphg's full-sized avatar

Garett PHG gphg

  • NKRI
  • 09:35 (UTC +07:00)
View GitHub Profile
@odan
odan / xampp_php7_xdebug.md
Last active February 26, 2026 18:45
Installing Xdebug for XAMPP
@tim545
tim545 / lg-jquery-app-struct.md
Last active July 18, 2025 18:46
Structuring a large jQuery application

Structuring a large jQuery application

This document assumes you are building a traditional backend-heavy application as opposed to a frontend-heavy appliction which would typically use a framework like Angular or React. The use of these frameworks make this document irrelevant, however also require a change to your application architecture and a much larger overhead in order to get content onto a page, so as a simple way to build interactive web content a simple jquery based js stack will do fine.

Directory structure

It's important you use a directory structure which is impartial to your development environment, chosen server language (Python v. Java v. C# ...), and styling framwork (Twitter Bootstrap etc). This layer of separation means you can swap out the styles or the backend with minimal changes to the Js, simple and maintainable.

Here's an example from the project root:

@dmnsgn
dmnsgn / WebGL-WebGPU-frameworks-libraries.md
Last active July 26, 2026 06:46
A collection of WebGL and WebGPU frameworks and libraries

A non-exhaustive list of WebGL and WebGPU frameworks and libraries. It is mostly for learning purposes as some of the libraries listed are wip/outdated/not maintained anymore.

Engines and libraries ⚙️

Name Stars Last Commit Description
three.js ![GitH
@troyane
troyane / mp42gif.sh
Last active May 22, 2024 17:20
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="20"
input_height="512"
@heolin
heolin / event_manager.py
Created November 21, 2019 15:19
Simple event manager in python
class Mom:
def on_door_opened(self):
print("Who's there?")
class Priest:
def on_door_opened(self):
print("Is it police? Run!")
@mattdesl
mattdesl / rgb-cmyk.glsl
Last active November 24, 2025 19:25
RGB / CMYK conversion in GLSL
// From the book: Graphics Shaders
vec3 CMYKtoRGB (vec4 cmyk) {
float c = cmyk.x;
float m = cmyk.y;
float y = cmyk.z;
float k = cmyk.w;
float invK = 1.0 - k;
float r = 1.0 - min(1.0, c * invK + k);
@oofnikj
oofnikj / answerfile
Last active June 22, 2026 12:21
Install Docker on Termux
KEYMAPOPTS="us us"
HOSTNAMEOPTS="-n alpine"
INTERFACESOPTS="auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp
hostname alpine
"
TIMEZONEOPTS="-z UTC"
@odan
odan / nginx-php-windows-setup.md
Last active April 1, 2026 00:25
Nginx and PHP Setup on Windows

Nginx and PHP Setup on Windows

For local development you could also use Nginx with PHP as an replacement for XAMPP.

Install Nginx

A metatable in Lua defines various extraneous behaviors for a table when indexed, modified, interacted with, etc. They are Lua's core metaprogramming feature; most well known for being useful to emulate classes much like an OOP language.

Any table (and userdata) may be assigned a metatable. You can define a metatable for a table as such:

-- Our sample table
local tab = {}
-- Our metatable
local metatable = {
 -- This table is then what holds the metamethods or metafields
@Mrfiregem
Mrfiregem / meme-text.sh
Last active April 7, 2026 18:58
A bash script to add meme text to a video file using ffmpeg
#!/usr/bin/env bash
# Initialize variables to customize output
: "${FFILE:="${HOME}/.fonts/i/impact.ttf"}" # Let user choose font file
: "${FSIZE:=72}" # Let user choose font size in px
: "${BSIZE:=5}" # Let user choose stroke size in px
: "${OFFSET:='(h*0.05)'}" # Let user choose text offset in px
# TTEXT - Text to display at the top of the image
# BTEXT - Text to display at the bottom of the image
# Exit value index: