Skip to content

Instantly share code, notes, and snippets.

View astronaughts's full-sized avatar
💡
Working from home

Masahiro Ueno astronaughts

💡
Working from home
  • Chatwork
  • Osaka, Japan
View GitHub Profile
@astronaughts
astronaughts / app.js
Created May 4, 2011 08:53
Titanium mobile sample001
var tabGroup = Titanium.UI.createTabGroup();
// tab に埋め込む window。hoge.js から読み込む
var hoge = Titanium.UI.createWindow({
url: 'hoge.js'
});
// tab を作る
var tab = Titanium.UI.createTab({
title: 'hoge',
var tabGroup = Titanium.UI.createTabGroup();
var win = Titanium.UI.createWindow({
backgroundColor: '#D8D8D8',
barColor: '#000000',
title: 'じゃいけん'
});
var tab = Titanium.UI.createTab({
window: win
@astronaughts
astronaughts / app.js
Created December 19, 2011 15:14
Baruth vol.1
// this sets the background color of the master UIView (when there are no windows/tab groups on it)
Titanium.UI.setBackgroundColor('#000');
var tabGroup = Titanium.UI.createTabGroup();
var win = Titanium.UI.createWindow();
win.hideTabBar();
win.navBarHidden = true;
var tab = Titanium.UI.createTab({window: win});
var Z_INDEX_TOP = 3;
var Z_INDEX_BOTTOM = 0;
@astronaughts
astronaughts / fql_multi.py
Created April 12, 2012 06:58
Python で Facebook API の fql.multi する例
# Facebook API なクラスのお供に。
import urllib
import simplejson
def fql_multi(self, access_token, **queries):
args = {
'queries': simplejson.dumps(queries),
'format': 'json',
'access_token': access_token
@astronaughts
astronaughts / TypeScript.sublime-build
Created October 18, 2012 04:57
Sublime Text 2: TypeScript build setting file. this file into Packages/User dir.
{
"selector": "source.ts",
"cmd": ["tsc", "$file"],
"osx": {
"path": "/usr/local/bin:/opt/local/bin"
}
}
@astronaughts
astronaughts / Container.js
Created November 5, 2012 05:36
【5日】fireEvent の使い所
var Container = function(){
var self = Ti.UI.createScrollableView({
top: 100,
right: 20,
bottom: 20,
left: 20,
backgroundColor: '#999'
});
var pane_red = Ti.UI.createView({
@astronaughts
astronaughts / app.js
Created November 30, 2012 01:13
【30日目】Titanium mobile で ScrollableView に載せた button(?)のクリック/スワイプ制御
(function(){
var win = Ti.UI.createWindow();
// view 1 枚目
var view1 = Ti.UI.createView({
backgroundColor: '#ffffbb'
});
// view 1 枚目にのせるニセボタン
var button1 = Ti.UI.createView({
@astronaughts
astronaughts / app.js
Created December 2, 2012 14:07
【3日目】Titanium mobile でも使える非同期処理のためのライブラリ「async.js」
(function(){
var async = require('async');
// 順次処理
async.series([
function(callback){
var message = 'one';
Ti.API.info(message);
callback(null, message);
// Usage : less2stylusDir('../src/css/');
var fs = require('fs');
// this less 2 stylus conversion script make a stylus easy to read syntax
// - let the braces
// - replace the @ for var as $
// - let semicolons
function less2stylus(less)
@astronaughts
astronaughts / Gruntfile.js
Created March 10, 2013 04:35
Titanium mobile で grunt watch で CoffeeScript をコンパイルする CoffeeScript >> TI_PROJECT/src/**/*.coffee JavaScript >> TI_PROJECT/Resources/**/*.coffee
module.exports = function(grunt) {
grunt.config.init({
pkg: grunt.file.readJSON('package.json'),
watch: {
scripts: {
files: ['src/**/*.coffee'],
tasks: ['coffee'],
options: {
interrupt: true