This file contains hidden or 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
---------------------------------------------------------------------------------- | |
-- | |
-- scene name | |
-- | |
---------------------------------------------------------------------------------- | |
local storyboard = require( "storyboard" ) | |
local scene = storyboard.newScene() | |
------------------------------------------------------------------------- |
This file contains hidden or 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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>name</key> | |
<string>Solarized-erin (dark)</string> | |
<key>settings</key> | |
<array> | |
<dict> | |
<key>settings</key> |
This file contains hidden or 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
------------------------------------------------- | |
-- | |
-- extends Group example | |
-- | |
------------------------------------------------- | |
local group = {} | |
local group_mt = { __index = group } -- metatable | |
------------------------------------------------- |
This file contains hidden or 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
------------------------------------- | |
-- group slide event | |
-- Erin Lin | |
------------------------------------- | |
local isActive = true | |
local slide = function(event) | |
if not isActive then return end | |
local W = display.contentWidth * .5 | |
local dis = 40 | |
local pos = (event.xStart < W and "L") or "R" |
This file contains hidden or 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
var login = function(args){ | |
xhr.open( 'GET', args.url ); | |
xhr.setRequestHeader('Accept', 'application/json'); | |
xhr.setRequestHeader('Content-Type', 'application/json'); | |
//TODO | |
var txt = Ti.Utils.base64encode( args.username + ':' + args.password).getText(); | |
xhr.setRequestHeader('Authorization','Basic '+ txt); |
This file contains hidden or 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
var content = ''; | |
var boundary = '---------------------------170062046428149'; | |
content += '--'+ boundary + '\r\n'; | |
content += 'Content-Disposition: form-data; name="uploadToken"\r\n'; | |
content += '\r\n'; | |
content += upload_token + '\r\n'; | |
content += '--'+ boundary + '\r\n'; | |
content += 'Content-Disposition: form-data; name="destFolderPath"\r\n'; | |
content += '\r\n'; |
This file contains hidden or 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
//http://me.dt.in.th/page/SpreadsheetToJSONP | |
function onEdit(e) { | |
var value = SpreadsheetApp.getActiveSpreadsheet().getSheets() | |
.filter(function(sheet) { return sheet.getName() != "JS" }) | |
.map(function(sheet) { | |
return { name: sheet.getName(), | |
values: sheet.getDataRange().getValues() }; | |
}); | |
SpreadsheetApp.getActiveSpreadsheet() | |
.getSheetByName("JS").getRange("B1").setValue(JSON.stringify(value)); |
This file contains hidden or 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
--[[ | |
statemachine.lua | |
Copyright (c) 2013 Erin Lin | |
erinylin.blogspot.com | |
Licensed under the MIT license. | |
Usage: | |
local sm = require("statemachine") | |
local process = sm.new(function(self, time) |
This file contains hidden or 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 sm = require("statemachine") | |
local process = sm.new(function(self, time) | |
self:sleep(100) | |
print("hello") | |
self:sleep(100) | |
print("hehe...") | |
self:sleep(100) | |
print("end") | |
end) |
This file contains hidden or 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 sm = require("statemachine") | |
local process = sm.new(function(self, time) | |
local txt = display.newText( "Press Me", display.contentCenterX, display.contentCenterY, native.systemFont, 32) | |
txt:addEventListener("touch", function(evt) | |
self:continue() | |
end) | |
self:waiting() | |
txt.text = "Hello!" | |
end) |
OlderNewer