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
<div class="capow-page" data-capowpage="1" lang="en-gb"> | |
<div class="capow-panel" data-capowpanel="1" data-capowaspectratio="4:3"> | |
<img class="capow-panelImage" src="../VisionMachine/assets/VM-CAPOW-P9-Panel5.png" alt="2 people are talking in a field"> | |
<p class="capow-caption" data-capowcaption="1" lang="en-gb"> | |
After 6 months of patience, the Sun began to break through the sad, cold winter blues | |
</p> | |
<p class="capow-baloon" data-capowballoon="1" lang="en-gb"> | |
<span class="capow-dialogue">What is this <strong>KAPOW</strong> thing?</span> | |
</p> | |
<p class="capow-baloon" data-capowballoon="2" lang="en-gb"> |
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
using terms from application "Mail" | |
on perform mail action with messages these_messages for rule this_rule | |
tell application "Mail" | |
display dialog ¬ | |
"Choose a follow up action" buttons {"Review", "Archive", "Cancel"} ¬ | |
default button "Cancel" | |
--set userSelection to value of button returned of result | |
if result = {button returned:"Cancel"} then | |
else if result = {button returned:"Archive"} then |
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
#!/usr/bin/python | |
''' | |
Copyright 2009, The Android Open Source Project | |
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 | |
http://www.apache.org/licenses/LICENSE-2.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
// you could create a simple function to check the platform and deploy default lang otherwise use strings.xml | |
// Call the function with LS("key); instead of L("key"); | |
// You will need to create a switch for each key in the function, but this is temporary | |
function LS(string) {"use strict"; | |
var str; | |
if (Ti.Platform.name === 'blackberry') { | |
Ti.API.log('warn', 'Blackberry detected, string manipulation'); |
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 }); |
NewerOlder