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: 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
//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
private double deg2rad(double deg) { | |
return (deg * Math.PI / 180.0); | |
} | |
private double rad2deg(double rad) { | |
return (rad * 180.0 / Math.PI); | |
} | |
@Kroll.method | |
public Double calcDistance(double lat1, double lon1, double lat2, double lon2, String unit){ | |
double theta = lon1 - lon2; |
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
# '60s | |
1960 Joan Baez | |
1961 Judy Collins | |
1962 Peter, Paul and Mary | |
1962 Sylvie Vartan | |
1963 Elis Regina |
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
if(Ti.Platform.osname == 'android'){ | |
var MapModule = require('ti.map'); | |
var rc = MapModule.isGooglePlayServicesAvailable(); | |
if(rc != MapModule.SUCCESS){ | |
var dialog = Ti.UI.createAlertDialog({ | |
title: 'ご利用の前に', | |
message: '本アプリを快適にご利用頂くために必要なアプリがあります。インストールしますか?', | |
buttonNames: ['インストールする', '今回はキャンセルする'] | |
}); | |
dialog.addEventListener('click', 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
#app/models/concerns/loopback.rb | |
module Loopback | |
extend ActiveSupport::Concern | |
included do | |
class << self | |
def element_path(id, prefix_options = {}, query_options = nil) | |
prefix_options, query_options = split_options(prefix_options) if query_options.nil? | |
"#{prefix(prefix_options)}/#{id}#{query_string(query_options)}" | |
end |
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 win = Ti.UI.createWindow({backgroundColor: '#FFFFFF', tabBarHidden:true, title: '素敵な右側'}); | |
var detailNav = Ti.UI.iOS.createNavigationWindow({window:win}); | |
var masterWindow = Ti.UI.createWindow({backgroundColor:'#FFFFFF', tabBarHidden:true, title:'ナイス左側'}); | |
var rows = []; | |
for( var i = 0; i < 5; i++ ){ | |
rows.push(Ti.UI.createTableViewRow({ | |
title: "title " + (i+1), | |
hasChild: true | |
})); |
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> |
NewerOlder