Skip to content

Instantly share code, notes, and snippets.

var win = Ti.UI.createWindow({
backgroundColor:'#fff'
});
var button = Ti.UI.createButton({
title:'button',
width:100,
height:44,
top:100
});
// this sets the background color of the master UIView (when there are no windows/tab groups on it)
Titanium.UI.setBackgroundColor('#000');
// create tab group
var tabGroup = Titanium.UI.createTabGroup();
//
// create base UI tab and root window
//
var win = Ti.UI.createWindow({
backgroundColor:'#fff'
});
var image = Ti.UI.createImageView({
image:'KS_nav_ui.png',
width:46,
heigth:43,
top:20,
left:20
var win = Ti.UI.createWindow({
backgroundColor:'#fff'
});
var web = Ti.UI.createWebView({
url:'http://jsdc.tw/'
});
win.add(web);
win.open();
var win = Ti.UI.createWindow({
backgroundColor:'#fff'
});
var web = Ti.UI.createWebView({
html:'<html>' +
' <head>' +
' <style type="text/css">' +
var win = Ti.UI.createWindow({
backgroundColor:'#fff'
});
var data = [];
for(var i = 0; i < 10 ; i++){
data.push({title:'row ' + i, hasDetail:true});
}
var table = Ti.UI.createTableView({
var win = Ti.UI.createWindow({
backgroundColor:'#fff'
});
var data = [];
for(var i = 0; i < 10 ; i++){
var row = Ti.UI.createTableViewRow({
height:90
});
// this sets the background color of the master UIView (when there are no windows/tab groups on it)
Titanium.UI.setBackgroundColor('#000');
// create tab group
var tabGroup = Titanium.UI.createTabGroup();
//
// create base UI tab and root window
//
@kevinbubu
kevinbubu / app.js
Created December 19, 2022 14:05
ChatGPT - LINE Chatbot
const express = require('express');
const line = require('@line/bot-sdk');
const request = require('request');
const CHANNEL_ACCESS_TOKEN = 'YOUR_CHANNEL_ACCESS_TOKEN';
const CHANNEL_SECRET = 'YOUR_CHANNEL_SECRET';
const OPENAI_API_KEY = 'YOUR_OPENAI_API_KEY';
// 建立 LINE Bot 物件
const config = {