Skip to content

Instantly share code, notes, and snippets.

View nazrdogan's full-sized avatar
🎯
Busy

Nazır Doğan nazrdogan

🎯
Busy
View GitHub Profile
@mschmulen
mschmulen / TableViewNeverending.js
Created February 1, 2011 02:07
Titanium tableView with a continuous amount of data.
//
// in this demo, we simply show how you could dynamically scroll
// with a continuous amount of data in the tableview by detecting
// when the user's scroll position gets near the end of the table
// and start a background fetch of new data and seamlessly append
// the new data to the table automatically
//
var win = Ti.UI.createWindow();
@aaronksaunders
aaronksaunders / app.js
Created October 15, 2011 06:58
Text field validator only alpha
var win1 = Titanium.UI.createWindow({
title:'Tab 1',
backgroundColor:'#fff'
});
win1.open();
var alphaonly = Titanium.UI.createTextField({
color:'#336699',
height:35,
width:300,
@yagitoshiro
yagitoshiro / app.js
Created January 29, 2012 15:17
Titanium m3u audio streaming test
Titanium.UI.setBackgroundColor('#000');
var tabGroup = Titanium.UI.createTabGroup();
var win1 = Titanium.UI.createWindow({
title:'Tab 1',
backgroundColor:'#fff'
});
var tab1 = Titanium.UI.createTab({
icon:'KS_nav_views.png',
title:'Tab 1',
window:win1
@jonalter
jonalter / app.js
Created February 10, 2012 16:26
iOS: convert view layout to single image using toImage()
var win = Ti.UI.createWindow({backgroundColor:'white'});
win.open();
// build our layout with 2 views and 1 imageView
var mainView = Ti.UI.createView({top:10,height:200,width:200,backgroundColor:'blue'});
var view2 = Ti.UI.createView({height:100,width:100,backgroundColor:'green'});
var imageView = Ti.UI.createImageView({image:'http://www.appcelerator.com/wp-content/uploads/2011/01/Appcelerator-IDC-Q1-Mobile-Developer-Report-appclogo.png'});
mainView.add(view2);
view2.add(imageView);
@hectorcorrea
hectorcorrea / webserver.js
Last active November 17, 2022 19:54
web server in node.js
// A very basic web server in node.js
// Stolen from: Node.js for Front-End Developers by Garann Means (p. 9-10)
var port = 8000;
var serverUrl = "127.0.0.1";
var http = require("http");
var path = require("path");
var fs = require("fs");
var checkMimeType = true;
@stephenfeather
stephenfeather / analytics.js
Created June 2, 2012 18:09
commonJS version of Roger Chapman's Google Analytics Library for Appcelerator's Titanium Mobile SDK
/*
The MIT License
Copyright (c) 2010 Roger Chapman
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@Mithrandir0x
Mithrandir0x / gist:3639232
Created September 5, 2012 16:15
Difference between Service, Factory and Provider in AngularJS
// Source: https://groups.google.com/forum/#!topic/angular/hVrkvaHGOfc
// jsFiddle: http://jsfiddle.net/pkozlowski_opensource/PxdSP/14/
// author: Pawel Kozlowski
var myApp = angular.module('myApp', []);
//service style, probably the simplest one
myApp.service('helloWorldFromService', function() {
this.sayHello = function() {
return "Hello, World!"
@nitinthewiz
nitinthewiz / login
Created October 28, 2012 09:33 — forked from forrestfrazier/login
log in to web app and return data to be saved in titanium app
//var win = Titanium.UI.currentWindow;
var currentWin = Ti.UI.currentWindow;
// if successful login - save user data to database
function insertRows(dbData) {
// call the database and table
var db = Ti.Database.install('../myapp.sqlite','users');
// call out the info to save then save it
var theData = db.execute('INSERT INTO users (username, email) VALUES("'+name.value+'","'+email.value+'")');
@mstepanov
mstepanov / app.js
Created March 19, 2013 23:19
Titanium ListView Examples
var rootWin = Ti.UI.createWindow();
var navGroup = Ti.UI.iPhone.createNavigationGroup({
window: rootWin
});
var button = Ti.UI.createButton({
title: 'Open ListView Tests'
});
button.addEventListener('click', function() {
openTestsWindow();
});
@ricardoalcocer
ricardoalcocer / text
Last active May 20, 2016 09:20
When doing console.log on Android, get the output on the Terminal.
The ADB excecutable lives in:
[path-to-android-sdk]/platform-tools/
./adb -e logcat | grep TiAPI
or
./adb -d logcat | grep TiAPI