Skip to content

Instantly share code, notes, and snippets.

View iskugor's full-sized avatar

Ivan Škugor iskugor

View GitHub Profile
var callback = function() {
//do something
}
...
var someObject = new SomeObjectConstructor();
someObject.on('click', callback);
...
@iskugor
iskugor / MakeTi.py
Created August 13, 2012 09:46
MakeTi - SublimeText2 how to deploy on device
//~/Library/Application Support/Sublime Text 2/Packages/MakeTi/MakeTi.py
import sublime, sublime_plugin
class MakeTiCommand(sublime_plugin.WindowCommand):
instance_list = ["android","android-device","iphone","ipad","web","clean"]
def run(self, *args, **kwargs):
@iskugor
iskugor / build.log
Created August 11, 2012 16:45
TiProfiler build log
This file has been truncated, but you can view the full file.
================================================================================
Appcelerator Titanium Diagnostics Build Log
The contents of this file are useful to send to Appcelerator Support if
reporting an issue to help us understand your environment, build settings
and aid in debugging. Please attach this log to any issue that you report.
================================================================================
Starting build at 08/11/12 17:32
Build details:
@iskugor
iskugor / app.js
Created August 10, 2012 14:33
ZenTi OOP - basic concept (extending demo)
//basic wrapper
function Element(props) {
this.setProperties(props);
}
Element.prototype = {
__TiElement: null,
__TiConstructor: Ti.UI.createView,
__getTiElement: function() {
if (!this.__TiElement) {
@iskugor
iskugor / app.js
Created July 3, 2012 15:33
Titanium infinite "postlayout" loop
...
label.addEventListener('postlayout', function() {
label.height += 100; //causes infinite loop (or not :D )
});
...
@iskugor
iskugor / app.js
Created July 3, 2012 14:37
Titanium: Crazy "postlayout" event
var win = Ti.UI.createWindow({
backgroundColor: '#000',
layout: 'vertical',
    navBarHidden: true
});
var button = Ti.UI.createButton({
title: 'Add table'
});
@iskugor
iskugor / app.js
Created June 9, 2012 14:38
ZenTi - advanced extending
//get ZenTi library
var ZenTi = require('/library/zen_ti');
//Window constructor
var Window = ZenTi.include('window', 'ui');
//Button constructor
var Button = ZenTi.include('button', 'ui');
//List container constructor
@iskugor
iskugor / app.js
Created June 4, 2012 12:13
Titanium WTF: Window children property
var win = Ti.UI.createWindow({ backgroundColor: "#fff", navBarHidden: true, layout: 'horizontal' });
var view = Ti.UI.createView({
layout: 'horizontal'
});
var label1 = Ti.UI.createLabel({
top: 150,
left: 50,
text: 'Testing 1 ...',
@iskugor
iskugor / app.js
Created May 23, 2012 13:31
Titanium: How to append table view section to rendered table view
(function() {
var win = Ti.UI.createWindow({ backgroundColor: "#f00" });
var table = Ti.UI.createTableView();
var rows = [];
for (var i = 0; i < 4; ++i) {
rows.push({ title: "Row 0", header: "Header " + i, className: "Row1" });
for (var j = 0; j < 10; j++) {
@iskugor
iskugor / app.js
Created May 9, 2012 13:16
Titanium: How to empty table view section
(function() {
var win = Ti.UI.createWindow({ backgroundColor: "#f00" });
var table = Ti.UI.createTableView();
var rows = [];
for (var i = 0; i < 4; ++i) {
rows.push({ title: "Row 0", header: "Header " + i, className: "Row1" });
for (var j = 0; j < 10; j++) {