lua

Get table size: You have to manually count each element

Tag(s):

local tbl = {"dog", "cat", "mouse", name="dolphin&qu

Date & Time

Tag(s):

-- Current date and time.
local current_unix_timestamp = os.time()
print(current_unix_timestamp)
 

Lua: Sample class implementation

Tag(s):

--[[
Description 
  * 1 of many ways to write object oriented code with Lua.
 
Reference:
  * http://www.lua.org/pil/16.1.html
 
]]--
 
 
Account = {     -- Class declaration.

MPV scripting: Print hello world

Tag(s):

-- Description: Print "Hello World" when press 'g'.
--    This script should be put in ~/.mpv/lua/ directory.
 
require 'os'
require 'io'
require 'string'
Subscribe to RSS - lua