Skip to content

Instantly share code, notes, and snippets.

View srahim's full-sized avatar

Sabil Rahim srahim

  • Appcelerator
  • Mountain View, CA
View GitHub Profile
var win = Titanium.UI.createWindow({
backgroundColor:"white",
title:"blah"
});
Ti.API.info("Titanium.buildDate" + Titanium.buildDate);
var data = 'Build: ' + Titanium.version + ' HASH :: ' + Titanium.buildHash + ' ( BUILD DATE :: ' + Titanium.buildDate + ')\n';
@srahim
srahim / _app_props_.json
Created January 6, 2014 22:24
anvil file
{
"driver.socketPort":40405
}
@srahim
srahim / app.js
Created November 22, 2013 19:35
mapview
var win = Ti.UI.createWindow();
var Map = Ti.Map;
var map = Map.createView({
userLocation: true,
mapType: Map.NORMAL_TYPE,
animate: true,
region: {latitude: -33.87365, longitude: 151.20689, latitudeDelta: 0.02, longitudeDelta: 0.02 }, //Sydney
top: '50%',
// top:200,
@srahim
srahim / app.js
Last active December 28, 2015 03:19
Background fetch download.
//This is a more rudimentary test to ensure that downloads continue while in the background of the app.
//global variables
var bgDownload = require("com.appcelerator.urlSession");
Ti.App.iOS.setMinimumBackgroundFetchInterval(Ti.App.iOS.BACKGROUNDFETCHINTERVAL_MIN);
var bgHandlerID,
sessionConfig,
session,
appUI = {},
dlProgress = 0,
dlStarted = false,
@srahim
srahim / gist:7269313
Last active December 27, 2015 04:49
error when trying to use the completion handlers
/************app.hjs******/
@import("Foundation");
@import("UIKit");
exports.backgroundDownloadTaskWithURL = function(identifier, url, callback) {
if (identifier != null) {
var sessionConfig = NSURLSessionConfiguration.backgroundSessionConfiguration(identifier);
var session = NSURLSession.sessionWithConfiguration(sessionConfig);
var taskurl = NSURL.URLWithString(url);
[INFO] Compiling 420 source files
[ERROR] Error: build/src/js_custom_urlSessionDlgt.m:922:32: warning: incompatible pointer types passing 'TiPropertyNameArrayRef' (aka 'struct OpaqueTiPropertyNameArray *')
to parameter of type 'JSPropertyNameArrayRef' (aka 'struct OpaqueJSPropertyNameArray *') [-Wincompatible-pointer-types]
JSPropertyNameArrayRelease(properties);
^~~~~~~~~~
In module 'JavaScriptCore' imported from build/src/js_custom_urlSessionDlgt.h:10:
/Users/sabilrahim/Documents/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk/System/Library/Frameworks/JavaScriptCore.
framework/Headers/JSObjectRef.h:663:66: note: passing argument to parameter 'array' here
JS_EXPORT void JSPropertyNameArrayRelease(JSPropertyNameArrayRef array);
^
@srahim
srahim / gist:7206770
Created October 28, 2013 23:41
console log.
[ERROR] : Failed to run command "build"
[ERROR] : TypeError: Cannot read property 'name' of undefined
at build (/Users/sabilrahim/Library/Application Support/Titanium/mobilesdk/osx/3.2.0.20131029050333/iphone/cli/commands/_build.js:929:152)
at /Users/sabilrahim/Library/Application Support/Titanium/mobilesdk/osx/3.2.0.20131029050333/iphone/cli/commands/_build.js:842:30
at /usr/local/lib/node_modules/titanium/lib/hook.js:214:18
at /usr/local/lib/node_modules/titanium/node_modules/async/lib/async.js:229:13
at async.eachSeries (/usr/local/lib/node_modules/titanium/node_modules/async/lib/async.js:127:20)
at _asyncMap (/usr/local/lib/node_modules/titanium/node_modules/async/lib/async.js:223:9)
at Object.mapSeries (/usr/local/lib/node_modules/titanium/node_modules/async/lib/async.js:213:23)
at async.series (/usr/local/lib/node_modules/titanium/node_modules/async/lib/async.js:546:19)
@srahim
srahim / analtyics events
Created June 4, 2013 00:05
analytics event
[
{
"id":"ed838e3e-8d23-4279-8bc0-d4277e99c750:d58b3ec88cedad27",
"sid":"d1ce9968-4074-4264-8d95-1285b2e9e6fd",
"ts":"2013-06-03T23:56:23.555+0000",
"event":"ti.start",
"data":{
"platform":"android",
"os":"Android",
"model":"Nexus 4",
@srahim
srahim / log
Created June 3, 2013 19:03
log from AppcStudio
This file has been truncated, but you can view the full file.
!SESSION 2013-03-11 14:37:52.487 -----------------------------------------------
eclipse.buildId=3.1.0.201303111308
java.version=1.6.0_33
java.vendor=Apple Inc.
BootLoader constants: OS=macosx, ARCH=x86, WS=cocoa, NL=en_US
Framework arguments: -keyring /Users/qetest/.eclipse_keyring -showlocation
Command-line arguments: -os macosx -ws cocoa -arch x86 -keyring /Users/qetest/.eclipse_keyring -consoleLog -showlocation
!ENTRY org.eclipse.core.net 1 0 2013-03-11 14:41:49.653
!MESSAGE System property http.nonProxyHosts has been set to local|*.local|169.254/16|*.169.254/16 by an external source. This value will be overwritten using the values from the preferences
@srahim
srahim / app.js
Created April 29, 2013 21:54
app.js for test one - TIMOB-13712
var win = Ti.UI.createWindow();
var button = Titanium.UI.createButton({
title: 'Hello',
top: 10,
width: 100,
height: 50
});
win.add(button);
win.open();