This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local rawget = rawget | |
local rawset = rawset | |
local setmetatable = setmetatable | |
local tostring = tostring | |
local error = error | |
local type = type | |
local print = print |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local Matrix = require("matrix") | |
print(tostring(Matrix(3))) | |
local mat = Matrix(3) | |
mat[1][1] = 1 | |
mat[1][2] = 2 | |
mat[1][3] = 3 | |
mat[2][1] = 4 | |
mat[2][2] = 5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function SomeFunc() | |
local x = 3 | |
local function InnerFunc() | |
x = 22 | |
end | |
InnerFunc() | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def SomeFunc(): | |
x = 3 | |
def InnerFunc(): | |
x = 22 | |
InnerFunc() | |
return x |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local socket = require("socket") | |
local http = require("socket.http") | |
--Safety is overrated. Pull scripts form the web! | |
local function webclude(target, ...) | |
local body, status, res_head, res_stat = http.request(target, ...) | |
if body then | |
return body |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--[[ | |
Method missing should be an optional definition on any object. | |
If a method cannot be found, method_missing is called if available | |
]] | |
local field = '__method__missing' | |
function method_missing(selfs, func) | |
local meta = getmetatable(selfs) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local color = Color(255, 255, 255, 255) | |
Voxel.display.color = color | |
Voxel.display:zero() | |
local function toggleCore(center, size) | |
for x=center-size,center+size do | |
for y=center-size,center+size do | |
for z=center-size,center+size do | |
if math.sqrt((x-center)^2 + (y-center)^2 +(z-center)^2)<=size then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local copymember = { | |
['function'] = function(val, memo) | |
local copy; | |
local err = pcall(function() --handling the error is faster than getting debug info | |
copy = loadstring(string.dump(val)) | |
end) | |
if (not copy) then | |
memo[val] = val | |
return val | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(window) { | |
//Step 1: Promised wrapper for XMLHTTPRequest | |
function Request(url, options) { | |
return new Promise(function(resolve, reject) { | |
if (!options) { | |
if (typeof(url) == "string") { | |
options = { url: url }; | |
} else { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install so many prerequisite libraries: | |
sudo yum groupinstall "Development tools" | |
sudo yum install openssl-devel git qt-devel boost boost-devel libsndfile-devel avahi avahi-compat-libdns_sd avahi-compat-libdns_sd-devel protobuf-compiler protobuf-devel gettext gettext-devel festival libtool-ltdl-devel libffi-devel pcre-devel readline-devel automake libtool gtk-devel intltool dotconf speech-dispatcher speech-dispatcher-devel alsa-lib-devel libdaemon-devel libusb-devel libtool rpm-build | |
# Clone the client’s source: | |
cd ~ | |
git clone https://github.com/mumble-voip/mumble.git | |
cd mumble | |
# Checkout a stable revision: | |
git checkout 1.2.x | |
# Build the makefile: |
OlderNewer