Skip to content

Instantly share code, notes, and snippets.

@rborn
rborn / gist:63113167aace181f4f8b
Created October 14, 2014 12:12
Delete iOS8 simulator NSUserDefaults (Ti.App.Properties) on app uninstall
Delete this file
/Users/YOUR_USER/Library/Developer/CoreSimulator/Devices/SIM_UDID/data/Library/Preferences/APP_ID.plist
@rborn
rborn / tiapp.xml
Last active August 29, 2015 14:06 — forked from grantges/tiapp.xml
<key>NSLocationAlwaysUsageDescription</key>
<string>
YOUR DESCRIPTOIN GOES HERE - EX. This application would like to use your current location.
</string>
@rborn
rborn / app.js
Last active August 29, 2015 14:06
blur
// backview is any view
blurred_view = utils.make_blur({
to_blur:backview,
width:320,
opacity:0.6, //<--
right:0,
zIndex:1,
blursize:1.2 //<--
});
@rborn
rborn / TiUIWindowProxy.m
Created August 24, 2014 09:20 — forked from artanisdesign/TiUIWindowProxy.m
iOS navButtons spacing
//from line 502
-(void)setRightNavButton:(id)proxy withObject:(id)properties
{
ENSURE_UI_THREAD_WITH_OBJ(setRightNavButton,proxy,properties);
if (properties == nil) {
properties = [self valueForKey:@"rightNavSettings"];
}
else {
[self setValue:properties forKey:@"rightNavSettings"];
// this file located in /Library/Application Support/Titanium/mobilesdk/osx/{version_number}
// add the following methods to GeolocationModule.mm
- (void)locationManager:(CLLocationManager *)manager didEnterRegion:(CLRegion *)region
{
NSDictionary *event = [NSDictionary dictionaryWithObjectsAndKeys:NUMBOOL(YES),@"success",[NSDictionary dictionaryWithObjectsAndKeys:NUMDOUBLE(region.center.latitude),@"lat",NUMDOUBLE(region.center.longitude),@"lng",NUMDOUBLE(region.radius),@"radius",region.identifier,@"identifier",nil],@"region",nil];
if ([self _hasListeners:@"enteredRegion"])
{
[self fireEvent:@"enteredRegion" withObject:event];
country = 'fr'
device = "Nokia N95 8Gb"
user_agent = 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT)'
mmap_url = 'http://www.google.com/glm/mmap'
geo_url = 'http://maps.google.com/maps/geo'
from struct import pack, unpack
from httplib import HTTP
import urllib2
$.mySwitch.addEventListener('change',function(e){
Ti.API.info('Switch value: ' + $.mySwitch.value);
});
tiRequire = require
!function(e){"object"==typeof exports?module.exports=e():"function"==typeof define&&define.amd?define(e):"undefined"!=typeof window?window.io=e():"undefined"!=typeof global?global.io=e():"undefined"!=typeof self&&(self.io=e())}(function(){var define,module,exports;
return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
module.exports = require('./lib/');
},{"./lib/":2}],2:[function(require,module,exports){
/**
$.recordCount.value = 99
var activity = Ti.Android.currentActivity;
var intent = Ti.Android.createIntent({
action : Ti.Android.ACTION_MAIN,
// you can use className or url to launch the app
// className and packageName can be found by looking in the build folder
// for example, mine looked like this
// build/android/gen/com/appcelerator/test/Test7Activity.java
// className : 'com.appcelerator.test.Test7Activity',
 
// if you use url, you need to make some changes to your tiapp.xml