Skip to content

Instantly share code, notes, and snippets.

View rajubd49's full-sized avatar

Md Harish Uz Jaman Mridha rajubd49

View GitHub Profile
@rajubd49
rajubd49 / index.js
Last active August 29, 2015 14:19
Fly out/in a view - Appcelerator titanium
var newtop = Ti.Platform.displayCaps.platformHeight + 20;
function doBox(e) {
$.box.animate({
top:newtop,
duration:2000,
autoreverse: true
});
}
$.index.open();
@rajubd49
rajubd49 / app.js
Created April 16, 2015 11:07
Full Screen Video playback in iOS - Appcelerator Titanium
var vidWin = Titanium.UI.createWindow({
title : 'Video',
backgroundColor : '#fff'
});
var videoPlayer = Titanium.Media.createVideoPlayer({
top : 2,
autoplay : true,
backgroundColor : 'blue',
height : 300,
@rajubd49
rajubd49 / app.js
Created April 16, 2015 12:57
GET and POST special characters to server - Appcelerator Titanium
//How to GET and POST special characters to server
var win=Titanium.UI.createWindow({
backgroundColor:'#fff'
});
var lbl = Titanium.UI.createLabel({
top:10,
width:300,
left:10,
@rajubd49
rajubd49 / app.js
Created April 16, 2015 12:58
Get phone's location, altitude, accuracy and speed - Appcelerator Titanium
Titanium.Geolocation.getCurrentPosition(function(e)
{
if (!e.success || e.error)
{
currentLocation.text = 'error: ' + JSON.stringify(e.error);
Ti.API.info("Code translation: "+translateErrorCode(e.code));
alert('error ' + JSON.stringify(e.error));
return;
}
var longitude = e.coords.longitude;
@rajubd49
rajubd49 / app.js
Created April 16, 2015 13:00
How to evaluate mathematical expression - Appcelerator Titanium
var win = Ti.UI.createWindow({backgroundColor : 'white'});
var txtFld = Ti.UI.createTextField({
height : 40,
width : 120,
backgroundColor : 'gray'
});
win.add(txtFld);
var numLbl = Ti.UI.createLabel({
@rajubd49
rajubd49 / app.js
Created April 16, 2015 13:01
How to play audio randomly - Appcelerator Titanium
var win = Ti.UI.createWindow({
backgroundColor : '#000',
layout:'vertical'
});
var mp3_array = [];
mp3_array.push('music/sound1.mp3');
mp3_array.push('music/sound2.mp3');
mp3_array.push('music/sound3.mp3');
@rajubd49
rajubd49 / app.js
Created April 16, 2015 13:03
How to rotate through a selection of colors - Appcelerator Titanium
var win = Ti.UI.createWindow({
fullscreen: true,
backgroundColor: 'blue',
});
setInterval(function(){
var backColor = win.backgroundColor;
if(backColor == 'blue'){
win.animate({backgroundColor: 'purple', duration: 1500});
win.backgroundColor = 'purple';
@rajubd49
rajubd49 / app.js
Created April 16, 2015 13:18
Image Slideshow - Appcelerator Titanium
var win = Ti.UI.createWindow();
var loaderImage = Ti.UI.createImageView({
width:150,
height:150
});
// set the length of the images you have in your sequence
var loaderArrayLength=3;
// initialize the index to 1
@rajubd49
rajubd49 / app.js
Created April 16, 2015 13:19
Image to PDF convertor-screenshot to pdf - Appcelerator Titanium
var PDF = require('bencoding.pdf');
var converters = PDF.createConverters();
var win = Ti.UI.createWindow({ backgroundColor:'#fff'});
var vwContent = Ti.UI.createView({
top:0, layout:'vertical'
});
win.add(vwContent);
vwContent.add(Ti.UI.createView({
@rajubd49
rajubd49 / OOP.swift
Last active April 17, 2018 10:37
Swift 4 - Object Oriented Programming Playground
//: Playground - noun: a place where people can play
import UIKit
print("Object Oriented Programming")
// Protocal
protocol PurchaseItem {
func cost() -> Float