Skip to content

Instantly share code, notes, and snippets.

@dasher
dasher / snippet.js
Last active December 10, 2015 01:34
snippet: Loading modules using the compoundJS "after extensions" event trigger. Logging is verbose but filtered by the logging wrapper methods - so you can turn up/down the amount of info with a config setting
// This code expects both app & compound to resolve to the appropriate variables
if (app.get("userModulesEnabled")) {
var userModules = []; // To allow access later
// Attach to the framework event
compound.on("after extensions",
function(){
// Load - currently nothing passed by the framework
// we attach our log handler to the compound tools object - so it's available to console based apps
// compound.tools.winston is the logger instance
/*
* You can add options to this file
* Options defined here will override all other options of the same name
* Additionally this file isn't tracked by git - so you can play with settings without affecting the rest of the app
*
* This file also allows machine specific overrides - for production
*
*/
module.exports = function (rootFolder, app) {
<?php
namespace Application\ExerciseBundle\Command;
use Symfony\Bundle\FrameworkBundle\Command\Command;
use Symfony\Components\Console\Input\InputArgument;
use Symfony\Components\Console\Input\InputOption;
use Symfony\Components\Console\Input\InputInterface;
use Symfony\Components\Console\Output\OutputInterface;
use Symfony\Components\Console\Output\Output;
/**
* There are several ways that a Ti Developer can create Android Activities & Services.
*/
/*
* Titanium Android Module SDK
* Native Java Module
* An example
*/
// this sets the background color of the master UIView (when there are no windows/tab groups on it)
Titanium.UI.setBackgroundColor('#fff');
var win1 = Titanium.UI.createWindow({
title:'Tab 1',
backgroundColor:'#000'
});
var image = Titanium.UI.createImageView({image:'KS_nav_ui.png', top:10, left:10});
{% extends "APIMeteringBundle::layout" %}
{% block title %}Index{% endblock %}
{% block content %}
{% import "APIMeteringBundle::macros" as forms %}
{% autoescape off %}
{{ form.renderAs('Renderer\\TablelessRenderer') }}
{{ form.render }}
{{ form.renderFormTag(formURL)}}
Client Reference: {{ form.refID.render }}
<path>1.3.3/titanium.py create
--platform=android
--type=module
--dir=<top most folder for the project>
--name=<projectName>
--android=<android SDK path >
--id=<the project class path ie: org.appcelerator.widget>
/**
* You don't need to specify this directly, a module definition class is generated for you as part of the build process for your module
*
*/
@Ti.module(
name = "UrbanAirships",
version = @version(buildVersion=0, minorVersion=0, majorVersion=1),
dependsUponTitanium = @version(minorVersion=3, majorVersion=1)
)
/**
* 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.
*/
package ti.modules.titanium.ui.widget;
public class TiUIText extends TiUIView
implements TextWatcher, OnEditorActionListener, OnFocusChangeListener
/**
* Menu
**/
/**
* initMenu(); - Clears & inits the menu object
* addMenuItem(MenuItem); - Which we pass a menuItem which is then added to an array of menu items
* buildMenu(); - which sets the menu (use from the calling window)
*/