Skip to content

Instantly share code, notes, and snippets.

function printf(s, ...)
print(s:format(...))
end
-- public domain
# LuaDist CMake utility library.
# Provides variables and utility functions common to LuaDist CMake builds.
#
# Copyright (C) 2007-2011 LuaDist.
# by David Manura, Peter Drahos
# Redistribution and use of this file is allowed according to the terms of the MIT license.
# For details see the COPYRIGHT file distributed with LuaDist.
# Please note that the package source code is licensed under its own license.
## INSTALL DEFAULTS (Relative to CMAKE_INSTALL_PREFIX)
@davidm
davidm / meta-interpolate.lua
Created November 4, 2011 03:42
Lua metaprogramming using custom searcher with string interpolation example
--[[
The following example illustrates string interpolation [1]
by way of a preprocessor that runs as a customer searcher
function in package.loaders.
Tested in Lua 5.2.0-beta.
Depends on
file_slurp https://gist.github.com/1325400 (for loading files simply)
luabalanced https://github.com/davidm/lua-balanced (for Lua parsing)
@davidm
davidm / sourceunpack.lua
Created December 2, 2011 07:35
Lua module 'sourcepack' - Extract Lua files from other Lua files.
#!/usr/bin/env lua
--[[ FILE README.txt
LUA MODULE
sourceunpack v$(_VERSION) - Extract Lua files containing other Lua files.
SYNOPSIS