Fading Coder

One Final Commit for the Last Sprint

Implementing a Red Packet Rain System with Redis and Lua

In 2018, live quiz shows like Wang Sicong's "Chongding Dahui," Xigua Video's "Million Heroes," and Inke's "Cheese Superman" became wildly popular. An e-commerce company I worked for joined this trend, and the tech team developed a live quiz feature. After a quiz ended,...

Integrating Lua Scripts into OpenResty: A Comprehensive Guide

Introduction to Lua Integration in OpenResty OpenResty provides multiple mechanisms for embedding Lua code directly into the Nginx configuration. This article explores the various methods available for incorporating Lua logic into your OpenResty applications. Methods for Embedding Lua in OpenResty D...

Core Sorting Algorithms and Lua Patterns for Unity Engineers

Bubble Sort Implementation This algorithm iterates through the dataset multiple times, swapping adjacent elements if they are in the wrong order. An optimization flag is included to terminate early if the list becomes sorted before all passes complete. public static void ExecuteBubbleSortion(int[] d...

Understanding Global Variables and Function Environments in Lua 5.1

In Lua 5.1, values of type thread, function, and userdata may each be linked to an environment table. That table is an ordinary Lua table used to hold names that the object resolves as "globals." Thread (coroutine) environments are only reachable from C. Userdata environments exist mainly...