Skip to content

Instantly share code, notes, and snippets.

Ian Tearle iantearle

Block or report user

Report or block iantearle

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
iantearle /
Created Apr 18, 2013 javascript library. Not currently working. Functions are not waiting for xhr data to complete. I have added a proxy script to help with cross domain policies. You should be able to run everything with these files. Please help me solve this. Many thanks. You can get your own API key from
* Helper Class for webservice
function ForecastIO(api_key) {
* Create a new instance
* @param String $api_key
View social.js
function hex_sha1(s) {
return binb2hex(core_sha1(str2binb(s), s.length * chrsz));
function b64_sha1(s) {
return binb2b64(core_sha1(str2binb(s), s.length * chrsz));
function str_sha1(s) {
return binb2str(core_sha1(str2binb(s), s.length * chrsz));
iantearle / Existing File in Lib folder.js
Last active Dec 14, 2015
Alloy breaks TiFont by rewriting the javascript. See for library
View Existing File in Lib folder.js
function SSSocial(options) {
switch (Ti.Platform.osname) {
case 'iphone':
case 'ipad':
this.fontfamily = 'SSSocialRegular';
case 'android':
this.fontfamily = 'SSSocialRegular';
iantearle / movie.js
Created Dec 11, 2012
movie player to play multiple videos. Needs ability to skip.
View movie.js
// Application Window Component Constructor
function Movie(_u, all) {
if(all) {
var mp4_array = ['12345.m4v', 'GrandOldDuke.m4v', 'TwinkleTwinkle.m4v', 'LittleBoPeep.m4v', 'LondonBridge.m4v', 'OldMotherHubbard.m4v', 'PataCake.m4v', 'PollyPutTheKettleOn.m4v', 'RockabyeBaby.m4v', 'TwinkleTwinkle.m4v'];
_u = mp4_array[0];
// Create our main window
// this file located in /Library/Application Support/Titanium/mobilesdk/osx/{version_number}
// add the following methods to
- (void)locationManager:(CLLocationManager *)manager didEnterRegion:(CLRegion *)region
NSDictionary *event = [NSDictionary dictionaryWithObjectsAndKeys:NUMBOOL(YES),@"success",[NSDictionary dictionaryWithObjectsAndKeys:NUMDOUBLE(,@"lat",NUMDOUBLE(,@"lng",NUMDOUBLE(region.radius),@"radius",region.identifier,@"identifier",nil],@"region",nil];
if ([self _hasListeners:@"enteredRegion"])
[self fireEvent:@"enteredRegion" withObject:event];
iantearle /
Created Nov 15, 2012 — forked from erikh/
OSX For Hackers
#!/usr/bin/env sh
# This is script with usefull tips taken from:
# install it:
# curl -sL | sh
iantearle / Login.js
Created Nov 5, 2012
Trying to retrieve the values from username and password in Login.
View Login.js
//FirstView Component Constructor
function Login() {
var Title = require('ui/common/Title'),
Logo = require('ui/common/Logo');
UserPassword = require('ui/common/UserPassword');
//create object instance, a parasitic subclass of Observable
var self = Ti.UI.createView({
width: Ti.Platform.displayCaps.platformWidth - 50,
left: 50
iantearle / RateMe.js
Created Nov 1, 2012 — forked from psyked/RateMe.js
"Rate my app in Appcelerator Titanium Mobile" as a commonJS module.
View RateMe.js
function RateMe(ios_url, goog_url, usecount) {
if(!Ti.App.Properties.hasProperty('RemindToRate')) {
Ti.App.Properties.setString('RemindToRate', 0);
var remindCountAsInt = parseInt(Ti.App.Properties.getString('RemindToRate'), 10);
var newRemindCount = remindCountAsInt += 1;
if(remindCountAsInt === -1) {
// the user has either rated the app already, or has opted to never be
// reminded again.
iantearle / gist:3055657
Created Jul 5, 2012
JSON stringify no work...
View gist:3055657
// The following result from query is great, has createdAt which is exactly what I want. Only thing is I want to cache this result on the device. If I JSON.stringify it, all I get is the attributes.
"_dirty" = {
"_escapedAttributes" = {
"_handleSetOp" = "<KrollCallback: 0xff4b850>";
"_hashedJSON" = {
iantearle / gist:2958439
Created Jun 20, 2012
iPad UA Module replication of bug
View gist:2958439
// this sets the background color of the master UIView (when there are no windows/tab groups on it)
var UrbanAirship = require('ti.urbanairship');
// create tab group
var tabGroup = Titanium.UI.createTabGroup();
UrbanAirship.options = {
You can’t perform that action at this time.