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 ruby | |
dir = "#{ENV['HOME']}/Library/Application\ Support/Titanium/mobilesdk/osx/*GA" | |
sdk = "#{Dir.glob(dir).sort.last}/titanium.py" | |
exec "#{sdk.gsub(/ /, '\ ')} #{ARGV.join(" ")}" |
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
<!--前略--> | |
<android xmlns:android="http://schemas.android.com/apk/res/android"> | |
<tool-api-level>8</tool-api-level> | |
<manifest android:versionCode="1" android:versionName="1.0" package="com.activate.mohh"> | |
<supports-screens android:anyDensity="true"/> | |
<uses-sdk android:minSdkVersion="8"/> | |
<receiver | |
android:name="com.google.android.gcm.GCMBroadcastReceiver" android:permission="com.google.android.c2dm.permission.SEND"> | |
<intent-filter> | |
<action android:name="com.google.android.c2dm.intent.RECEIVE"/> |
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
button.addEventListener('click', function(e){ | |
Ti.Media.openPhotoGallery({ | |
error: function(){}, | |
cancel: function(){}, | |
success: function(e){ | |
var size = Math.min(e.media.width, e.media.height) / 2; | |
var image = e.media.imageAsCropped({ | |
x: 0, | |
y: 0, | |
width: size, |
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
# モデルがこれだけで作れたら素敵じゃないか | |
# entry.coffee | |
Database = require('libs/database') | |
class Entry extends Database | |
initialize:()-> | |
@property 'title', 'text' | |
@property 'body', 'text' | |
super | |
module.exports = new Entry('entries') |
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
function ApplicationWindow(title) { | |
var self = Ti.UI.createWindow({ | |
title:title, | |
backgroundColor:'white' | |
}); | |
var compass = Ti.UI.createImageView({ | |
image:'/images/arrow.gif', | |
width:Ti.UI.SIZE, | |
height:Ti.UI.SIZE, |
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
/** | |
* This sample lets you record and share video with Appcelerator Titanium on Android. | |
* REQUIRES THE 1.6.0 RC OF TITANIUM MOBILE SDK | |
* http://developer.appcelerator.com/blog/2011/02/release-candidate-for-titanium-mobile-1-6-0.html | |
*/ | |
/** | |
* First, create our UI. We'll have two buttons: record, and share. | |
*/ | |
var win = Titanium.UI.createWindow({ |
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
/** | |
* This file was auto-generated by the Titanium Module SDK helper for Android | |
* Appcelerator Titanium Mobile | |
* Copyright (c) 2009-2010 by Appcelerator, Inc. All Rights Reserved. | |
* Licensed under the terms of the Apache Public License | |
* Please see the LICENSE included with this distribution for details. | |
* | |
* var mod = require('org.selfkleptomaniac.ti.mod.stupidimagereader'); | |
* var image = "washingmachine.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
win.addEventListener('android:back', ()-> | |
intent = Ti.Android.createIntent | |
action: Ti.Android.ACTION_MAIN | |
intent.addCategory Ti.Android.CATEGORY_HOME | |
Ti.Android.currentActivity.startActivity intent | |
return | |
) |
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
// Global Background Color | |
Ti.UI.setBackgroundColor("#000000"); | |
// Namespace | |
var APP = {}; | |
// Running | |
(function () { | |
// Window | |
var win = Ti.UI.createWindow({ |
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
save_button.addEventListener('click', ()-> | |
if Ti.Filesystem.isExternalStoragePresent | |
save_image = Ti.Filesystem.getFile(path).read() | |
new_path = Titanium.Filesystem.externalStorageDirectory + Date.now().toString() + ".png" | |
f = Ti.Filesystem.getFile(new_path) | |
result = f.write(save_image) | |
unless result | |
return null |