This file contains 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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# | |
# Make an iOS project transportable so that it can be zipped and | |
# sent to another machine | |
# | |
import os, sys, shutil, codecs, glob | |
template_dir = os.path.abspath(os.path.dirname(sys._getframe(0).f_code.co_filename)) |
This file contains 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
//ブラウザ全体でWebsocketを落としたらどうなるか試験するときに使う | |
// https://stackoverflow.com/a/31526291/5518615 | |
var WebSocket2 = WebSocket; | |
WebSocket = function(addy) { | |
var ws; | |
if (!this.blocked) { | |
console.log('WS: Not blocked, allowing.'); | |
ws = new WebSocket2(addy); | |
this.open_sockets.push(ws); |
This file contains 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
//Usage: | |
//var xml2json = require('TiDomParser'); | |
//xml2json(Ti.XML.parseString(xmlString)); | |
//original: http://hamasyou.com/blog/2010/09/15/titanium-xml2json-xml-json/ | |
/** | |
* @author hamasyou | |
* Copyright (C) 2010 hamasyou, INC. All Rights Reserved. | |
* |
This file contains 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
/* | |
Usage: yarn add request | |
``` | |
var linebot = require('./line_bot'); | |
var LineBot = bot.new({ | |
channelSecret: <YOUR CHANNEL SECRET>, | |
channelAccessToken: <YOUR CHANNEL ACCESS TOKEN> | |
}); | |
``` |
This file contains 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
//////////////////////push_notifications.js/////////////////////// | |
var apns = function(){ | |
var pref = require('preferences').preferences; | |
Titanium.Network.registerForPushNotifications({ | |
types: [ | |
Titanium.Network.NOTIFICATION_TYPE_BADGE, | |
Titanium.Network.NOTIFICATION_TYPE_ALERT | |
], | |
success:function(e) |
This file contains 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
Titanium.UI.setBackgroundColor('#000'); | |
var tabGroup = Titanium.UI.createTabGroup(); | |
var win1 = Titanium.UI.createWindow({ | |
title:'Tab 1', | |
backgroundColor:'#fff' | |
}); | |
var tab1 = Titanium.UI.createTab({ | |
icon:'KS_nav_views.png', | |
title:'Tab 1', | |
window:win1 |
This file contains 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 rows = []; | |
var table = Ti.UI.createTableView({top: 20}); | |
for(var i = 0; i < 2; i++){ | |
var row = Ti.UI.createTableViewRow({ | |
id: row + i.toString(), title: i.toString(), height: 110 | |
}); | |
rows.push(row); | |
} | |
var views = []; | |
views.push(Ti.UI.createImageView({height: 100, width: Ti.UI.SIZE, image:'images/black-cat.jpg'})); |
This file contains 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
<sdk-version>3.1.1.GA</sdk-version> | |
<modules> | |
<module platform="iphone">com.ti.calendar.permission</module> | |
</modules> |
This file contains 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
//app.js excerpt | |
var ApplicationTabGroup; | |
if(Ti.Platform.osname == 'android'){ | |
ApplicationTabGroup = require('ui/common/AndroidTabGroup'); // <- これを追加 | |
}else{ | |
ApplicationTabGroup = require('ui/common/ApplicationTabGroup'); | |
} | |
new ApplicationTabGroup(Window).open(); | |
//ui/common/AndroidTabGroup.js |
This file contains 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
//試験を開始するWindowにて | |
var Window, window; | |
Window = require('ui/handheld/Question'); | |
window = new Window(1); | |
window.containingTab = self.containingTab; | |
self.containingTab.open(window); | |
//ui/handheld/Question.js | |
function Question(id){ | |
var self, button; |
NewerOlder