Skip to content

Instantly share code, notes, and snippets.

@stereoket
stereoket / 1readme.md
Created May 10, 2017 15:45 — forked from jasonkneen/1readme.md
Quick example of registering a URLScheme in a Titanium app using the TiApp.xml without info.plist file. Just add the following into your TiApp.xml (I put it under the </iphone> tag. Works on Android and iOS.

Quick Example of registering a scheme in TiApp.xml, implementing the code in app.js / alloy.js

@stereoket
stereoket / InstagramMgr.js
Created May 7, 2017 20:05 — forked from aaronksaunders/InstagramMgr.js
Titanium Appcelerator Instagram Code ... This code is almost two years old and I havent tested it in a while
/**
*
* 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
*
@stereoket
stereoket / alloy.py
Last active August 29, 2015 14:07 — forked from joshjensen/alloy.py
# 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
@stereoket
stereoket / capow.html
Created November 26, 2013 16:03
CAPOW - HTML concept
<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">
@stereoket
stereoket / movemail.applescript
Last active December 19, 2015 17:19
Applescript for Mail.app to manage a workflow for your INBOX Zero - its simply moves the mail and is the last in a chain of pre-existing rules (this script is designed to work with MailTags plugin for Mail by Indev)
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
@stereoket
stereoket / coloredlogcat.py
Created April 14, 2013 22:45
ADB logcat colour highlighting script
#!/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
@stereoket
stereoket / app.js
Created March 14, 2013 17:59
i18n solution if cross platform apps required
// 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');
@stereoket
stereoket / UnitTestingJS
Created July 7, 2012 21:40 — forked from jackfranklin/UnitTestingPresentation
Brief intro to unit testing JavaScript presentation
#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?
<!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) {
@stereoket
stereoket / InfiniteScrollingTableView.js
Created April 10, 2012 22:52 — forked from dawsontoth/InfiniteScrollingTableView.js
Infinite loading table view for iOS and Android.
/**
* 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 });