Skip to content

Instantly share code, notes, and snippets.

@walterlua
walterlua / build.settings
Created September 21, 2012 02:17
Corona and iOS custom url schemes test case
settings = {
iphone =
{
plist =
{
CFBundleIconFile = "Icon.png",
CFBundleIconFiles = {
"Icon.png",
"Icon@2x.png",
"Icon-72.png",
@walterlua
walterlua / gist:3816630
Created October 2, 2012 06:06
Workaround for Nook HD bug
-- Workaround for Nook HD bug
local listener = function( event )
if "applicationResume" == event.type then
display.currentStage.alpha = 0.9
-- Force invalidate 1 second after resume
timer.performWithDelay( 1000, function()
display.currentStage.alpha = 1.0
end)
end
@walterlua
walterlua / build.settings
Created October 9, 2012 05:56
Corona: iOS 6, GameCenter, Landscape workaround
settings =
{
orientation =
{
default = "landscapeRight",
supported =
{
"landscapeRight",
"landscapeLeft",
},
@walterlua
walterlua / gist:3937293
Last active October 11, 2015 23:37
Detecting when webviews have finished loading #coronasdk
local function onWebViewEvent(event)
if "loaded" == event.type then
print("Finished loading: ", event.url )
end
end
local webView = native.newWebView( 0, 0, 500, 400 )
webView:addEventListener("urlRequest", onWebViewEvent)
webView:request("http://www.coronalabs.com")
@walterlua
walterlua / gist:7556165
Last active December 28, 2015 20:19
AndroidManifest.xml for OpenGL-ES 2 #coronasdk
<uses-feature android:glEsVersion="0x00020000"/>
@walterlua
walterlua / test.lua
Last active January 2, 2016 02:09
test #coronasdk
-- #coronasdk
print( "hello" )
@walterlua
walterlua / gist:3726123
Created September 15, 2012 02:31
Corona iPhone 5 tall app detection
local isTall = ( "iPhone" == system.getInfo( "model" ) ) and ( display.pixelHeight > 960 )
@walterlua
walterlua / table_indexOf.lua
Created May 18, 2011 07:38
Implementation of JavaScript array.indexOf() in Lua. Also, adds the function to Lua's table library
-- table.indexOf( array, object ) returns the index
-- of object in array. Returns 'nil' if not in array.
table.indexOf = function( t, object )
local result
if "table" == type( t ) then
for i=1,#t do
if object == t[i] then
result = i
break