I hereby claim:
- I am britzl on github.
- I am britzl (https://keybase.io/britzl) on keybase.
- I have a public key whose fingerprint is 0550 F9F9 695B AA0E C6A3 E29E 081A 6067 688C FEA3
To claim this, I am signing this object:
Thank you for your interest in Defold. In order to clarify the intellectual property license granted with Contributions from any person or entity, Defold must have a Contributor License Agreement ("CLA") on file that has been signed by each Contributor, indicating agreement to the license terms below. This license is for your protection as a Contributor as well as the protection of Defold and its users; it does not change your rights to use your own Contributions for any other purpose. | |
You accept and agree to the following terms and conditions for Your present and future Contributions submitted to Defold. Except for the license granted herein to Defold and recipients of software distributed by Defold, You reserve all right, title, and interest in and to Your Contributions. | |
1. Definitions. | |
"You" (or "Your") shall mean the copyright owner or legal entity authorized by the copyright owner that is making this Agreement with Defold. For legal entities, the entity making a Contribution and all other entities that |
#include <dmsdk/sdk.h> | |
#include "luautils.h" | |
void luaL_checklistener(lua_State* L, int idx, struct lua_Listener& listener) { | |
int top = lua_gettop(L); | |
luaL_checktype(L, idx, LUA_TFUNCTION); | |
lua_pushvalue(L, idx); | |
int cb = dmScript::Ref(L, LUA_REGISTRYINDEX); | |
if (listener.m_Callback != LUA_NOREF) { |
varying mediump vec2 var_texcoord0; | |
varying lowp vec4 var_face_color; | |
varying lowp vec4 var_outline_color; | |
varying lowp vec4 var_shadow_color; | |
uniform lowp vec4 texture_size_recip; | |
uniform lowp sampler2D texture; | |
uniform lowp vec4 tint; | |
void main() |
#!/bin/bash | |
title=$(less game.project | grep "^title = " | cut -d "=" -f2 | sed -e 's/^[[:space:]]*//') | |
title_no_space=$(echo -e "${title}" | tr -d '[[:space:]]') | |
echo "Project: ${title}" | |
if [ ! -f bob.jar ] | |
then | |
echo "Unable to find bob.jar. Download it from d.defold.com." | |
exit 1 |
--- Module that can be used to get a callback when a certain amount of time has elapsed | |
-- | |
-- @usage | |
-- local timer = require "timer" | |
-- function init(self) | |
-- self.t1 = timer.seconds(2, function() | |
-- print("2 seconds have elapsed") | |
-- end) | |
-- self.t2 = timer.seconds(5, function() | |
-- print("5 seconds have elapsed") |
#!/bin/bash | |
# Downloads an OS specific Lua 5.1 binary | |
if [[ "$OSTYPE" == "linux-gnu" ]]; then | |
LUA_DOWNLOAD_URL="http://sourceforge.net/projects/luabinaries/files/5.1.5/Tools%20Executables/lua-5.1.5_Linux32_64_bin.tar.gz/download" | |
LUA_BINARY=lua5.1 | |
elif [[ "$OSTYPE" == "darwin"* ]]; then | |
LUA_DOWNLOAD_URL="http://sourceforge.net/projects/luabinaries/files/5.1.5/Tools%20Executables/lua-5.1.5_MacOS109_bin.tar.gz/download" | |
LUA_BINARY=lua5.1 | |
elif [[ "$OSTYPE" == "win32" ]]; then |
# from http://stackoverflow.com/a/8597411/1266551 | |
if [[ "$OSTYPE" == "linux-gnu" ]]; then | |
# ... | |
elif [[ "$OSTYPE" == "darwin"* ]]; then | |
# Mac OSX | |
elif [[ "$OSTYPE" == "cygwin" ]]; then | |
# POSIX compatibility layer and Linux environment emulation for Windows | |
elif [[ "$OSTYPE" == "msys" ]]; then | |
# Lightweight shell and GNU utilities compiled for Windows (part of MinGW) | |
elif [[ "$OSTYPE" == "win32" ]]; then |
local function gdump() | |
local function dump_table(t, indentation) | |
indentation = indentation or "" | |
local table_model = {} | |
for k,v in pairs(t) do | |
table_model[type(v)] = table_model[type(v)] or {} | |
table_model[type(v)][k] = v | |
end | |
for type,_ in pairs(table_model) do | |
print(indentation .. type .. ":") |
--- A module for guarding tables from new indices. Typical use is to guard the global scope. | |
-- Get the latest version from https://gist.github.com/britzl/546d2a7e32a3d75bab45 | |
-- @module superstrict | |
-- @usage | |
-- | |
-- -- Defold specific example. Allow the gameobject and gui script lifecycle functions. Also allow assignment of | |
-- -- facebook and iap modules for dummy implementations on desktop. The whitelist handles pattern matching and in the | |
-- -- example all functions prefixed with '__' will also be allowed in the global scope | |
-- local superstrict = require("superstrict") | |
-- superstrict.lock(_G, { "go", "gui", "msg", "url", "sys", "render", "factory", "particlefx", "physics", "sound", "sprite", "image", "tilemap", "vmath", "matrix4", "vector3", "vector4", "quat", "hash", "hash_to_hex", "hashmd5", "pprint", "iap", "facebook", "push", "http", "json", "spine", "zlib", "init", "final", "update", "on_input", "on_message", "on_reload", "__*" }) |
I hereby claim:
To claim this, I am signing this object: