Quick Example of registering a scheme in TiApp.xml, implementing the code in app.js / alloy.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* | |
* this code was inspired by the work done by David Riccitelli | |
* | |
* Copyright 2011 Aaron K. Saunders, Clearly Innovative Inc | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Put me in: ~/Library/Application Support/Sublime Text 2/Packages/User/ | |
# Set your layout to Grid 4 - Go to view > layout > Grid: 4 | |
# Based on this Gist from Fokke - https://gist.github.com/FokkeZB/6218345 | |
# Alloy lay-out for Sublime Text http://withtitanium.com/2013/08/titanium-alloy-optimized-sublime-text-2-layout/ | |
# Put me in: ~/Library/Application Support/Sublime Text 2/Packages/User/ | |
import sublime, sublime_plugin, inspect | |
from os.path import splitext |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Unit Testing your JavaScript | |
##About Me | |
* University of Bath Computer Science student | |
* Placement at [Kainos](http://www.kainos.com) | |
* [JavaScript Playground](http://www.javascriptplayground.com) | |
* @Jack_Franklin | |
## Why Test at all? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | |
<title>SoundCloud OAuth 2 User Agent Authentication Flow Demo</title> | |
<script type="text/javascript" charset="utf-8" src="javascript/jquery-1.4.2.js"></script> | |
<script type="text/javascript" charset="utf-8"> | |
$(function () { | |
var extractToken = function(hash) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* We're going to create an infinite loading table view. Whenever you get close to the bottom, we'll load more rows. | |
*/ | |
var win = Ti.UI.createWindow({ backgroundColor: '#fff' }); | |
var isAndroid = Ti.Platform.osname === 'android'; | |
/** | |
* Create our UI elements. | |
*/ | |
var table = Ti.UI.createTableView({ top: 0, right: 0, bottom: 0, left: 0 }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//////////////////////push_notifications.js/////////////////////// | |
var apns = function(){ | |
var pref = require('preferences').preferences; | |
Titanium.Network.registerForPushNotifications({ | |
types: [ | |
Titanium.Network.NOTIFICATION_TYPE_BADGE, | |
Titanium.Network.NOTIFICATION_TYPE_ALERT | |
], | |
success:function(e) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// blog.clearlyinnovative.com | |
// Aaron K. Saunders | |
// Clearly Innovative Inc | |
// | |
// @see https://github.com/aaronksaunders/Appcelerator-Cocoafish-Native-Module | |
// | |
var cocoafishMgr = require('com.ci.cocoafish'); | |
Ti.API.info("module is => " + cocoafishMgr); |