Skip to content

Instantly share code, notes, and snippets.

@saggy
saggy / analytics.js
Created January 6, 2016 04:24 — forked from stephenfeather/analytics.js
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
var win1 = Titanium.UI.createWindow({
title:'Tab 1',
backgroundColor:'#fff',
layout: 'vertical'
});
var bt1 = Ti.UI.createButton({title: 'send message (method 1)', top: 200});
bt1.addEventListener('click', function(e)
@saggy
saggy / app.js
Created June 25, 2013 16:24 — forked from viezel/app.js
// This is an example of use.
// Here we use the new Bearer Token thats make it possible to get tweets without user login
// More info on Bearer here: https://dev.twitter.com/docs/auth/application-only-auth
// Full Codebird API is here: https://github.com/mynetx/codebird-js
var Codebird = require("codebird");
var cb = new Codebird();
cb.setConsumerKey('CONSUMER_KEY', 'CONSUMER_SECRET_KEY');
var bearerToken = Ti.App.Properties.getString('TwitterBearerToken', null);
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.adriatic.test" android:versionCode="1"
android:versionName="1">
<uses-sdk android:minSdkVersion="11" />
<!-- TI_MANIFEST -->
<application android:icon="@drawable/appicon"
android:label="Test Application" android:name="TestApplication"
Alloy.Globals.gc = function(ob, parent) {
if (ob.children) {
for (var c = (ob.children.length - 1); c >= 0; c--) {
Alloy.Globals.gc(ob.children[c], ob);
}
}
if (parent) {
parent.remove(ob);
ob = null;
}
Alloy.Globals.settings = {}; // Create Empty Object.
/* Settings Getter - Can also just access Alloy.Globals.settings[key] */
Alloy.Globals.settings.get = function(key) {
return Alloy.Globals.settings[key] || null;
}
/* Settings Saver */
Alloy.Globals.settings.set = function(key,value) {
var settings = Alloy.createCollection('settings');
Alloy.Globals.gc = function(ob, parent) {
if (ob.children) {
for (var c = (ob.children.length - 1); c >= 0; c--) {
Alloy.Globals.gc(ob.children[c], ob);
}
}
if (parent) {
parent.remove(ob);
ob = null;
}
/**
* This sample lets you record and share video with Appcelerator Titanium on Android.
* REQUIRES THE 1.6.0 RC OF TITANIUM MOBILE SDK
* http://developer.appcelerator.com/blog/2011/02/release-candidate-for-titanium-mobile-1-6-0.html
*/
/**
* First, create our UI. We'll have two buttons: record, and share.
*/
var win = Titanium.UI.createWindow({
// get the collection object
Alloy.Collections.instance("Fugitive");
// delete all items
Alloy.Collections.Fugitive.deleteAll();
@saggy
saggy / CountDown.cs
Created December 9, 2015 11:55 — forked from arlm/CountDown.cs
How to use CountDownTimer on Xamarin.Android
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Android.App;
using Android.Content;
using Android.OS;
using Android.Runtime;
using Android.Views;
using Android.Widget;