Skip to content

Instantly share code, notes, and snippets.

@cspencegists
cspencegists / 0_reuse_code.js
Created September 10, 2017 07:06
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@cspencegists
cspencegists / gist:4112132
Created November 19, 2012 17:35
Corona SDK: Set Background Color
display.setDefault( "background", 1:, 2:, 3: )
@cspencegists
cspencegists / gist:4111969
Created November 19, 2012 17:09
Corona SDK: Monitor Memory Usage
-- @DEBUG monitor Memory Usage
local printMemUsage = function()
local memUsed = (collectgarbage("count"))
local texUsed = system.getInfo( "textureMemoryUsed" ) / 1048576 -- Reported in Bytes
print("\n---------MEMORY USAGE INFORMATION---------")
print("System Memory: ", string.format("%.00f", memUsed), "KB")
print("Texture Memory:", string.format("%.03f", texUsed), "MB")
print("------------------------------------------\n")
end