Skip to content

Instantly share code, notes, and snippets.

View iantearle's full-sized avatar
💭
I may be slow to respond.

Ian Tearle iantearle

💭
I may be slow to respond.
View GitHub Profile
@dbankier
dbankier / gist:c0e15ff0babaa878112f
Created May 8, 2014 13:27
Add copyright/license note to the top of all js files
find . -type f | grep -v node_modules | grep -v modules | grep -v .git | grep -v .json | grep .js | xargs -I{} perl -pi -e 'print "/*\n * Copyright (c) 2011-2014 YY Digital Pty Ltd. All Rights Reserved.\n * Please see the LICENSE file included with this distribution for details.\n */\n\n" if $. == 1' {}
var search = Titanium.UI.createSearchBar({
barColor:'#000',
showCancel:true,
height:43,
top:0
});
var tableView = Titanium.UI.createTableView({
top:40,
data:{title:'Please perform a search'}
@kellymredd
kellymredd / filetypes
Created July 17, 2011 16:26
specify file types with your app
/*
This goes in your Info.plist
it's been a while since I added this functionality so I'm not sure what was added and what was already there, you may already have some pieces of the code.
When you tap and hold a mail attachment your app will show up in the list of associated apps and switch to your app when selected.
*/
<key>CFBundleURLTypes</key>
<array>
<dict>
@bob-sims
bob-sims / 00-readme.txt
Created November 28, 2011 22:28
CommonJS module to pull XML response from from (undocumented) Google Weather API, for use with Titanium Mobile
// console dump of sample returned object
I/TiAPI ( 244): (kroll$4: app://app.js) [797,3312] Object
I/TiAPI ( 244): {
I/TiAPI ( 244): weatherData => Object
I/TiAPI ( 244): {
I/TiAPI ( 244): forecastInfo => Object
I/TiAPI ( 244): {
I/TiAPI ( 244): city => 'Bydgoszcz, Kuyavian-Pomeranian Voivodeship',
@iantearle
iantearle / app.js
Created December 18, 2011 11:47 — forked from aaronksaunders/app.js
Stackmob & Appcelerator File Upload with Amazon S3
//include StackMob & credentials module
var credentials = require('credentials').C;
var stackmob = require('stackmob-module.min');
//create StackMob Client
var client = new stackmob.Client(credentials.STACKMOB_APP_NAME, credentials.STACKMOB_PUBLIC_KEY, credentials.STACKMOB_PRIVATE_KEY, credentials.STACKMOB_USER_OBJECT_NAME);
//login the user
client.login({
'username' : "aaron-B1FBD26C-89B1-49E3-B4C4-F319493324DB",
@aaronksaunders
aaronksaunders / index.html
Created March 26, 2012 17:27
Appcelerator Cloud Services with Backbonejs & Twitter Bootstrap
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link href="bootstrap/css/bootstrap.css" rel="stylesheet">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>New Appcelerator Cloud Services Project</title>
<script type="text/javascript">
function onBodyLoad() {
@raulriera
raulriera / DialogWindow.js
Created September 9, 2012 11:08
CustomAlertDialog commonJS module for Titanium Appcelerator. Similar to the "Tweetbot" (but will need more makeup of course) where the information is displayed below the title bar instead of an intrusive popup
DialogWindow = function(message, type){
// Default params
var message = message || "How about you add some message to this? :)";
var type = type || "error";
var window = Titanium.UI.createWindow({
width: 320,
height: 44,
top: 44,
@daneden
daneden / webhook.php
Last active December 12, 2015 07:18
Here’s the (somewhat stripped down/censored) script I’m using to deploy my sites. My old method had a script *per repo* inside the directory and added to `.gitignore`. Not a very maintainable or elegant solution. This way, I just hit an address with a query string. Obviously, the repo needs to be owned by the user that the web server is running …
<?php
/*
Usage: http://example.com/webhook.php?repo=repo-name
Obviously, for security, a different file name (or at least a different query string variable name) should be used.
*/
$path = null;
@grantges
grantges / WildText.js
Last active December 14, 2015 11:18
CommonJS Module for Titanium that allows you to create gradient filled Labels (note: iOS only) Updated to include updates from Todd Lindner - as noted here : https://gist.github.com/toddlindner/5093536
/*
WildText CommonJS module for Appcelerator Titanium
Create dynamic gradient filled text in your iOS Applications using this simple module.
@params : text - String. The text for your label
font - Font. Specify the font attributes for the label (defaults to standard size, weight and family),
backgroundGradient - BackgroundGradient. Specify your backgroundGradient object (defaults to White to Black linear gradient),
Top - Integer. Top property for your label,
Left - Integer. Left Property for your Label,
@FokkeZB
FokkeZB / app.js
Created April 19, 2013 08:17
How to decide what window to open first in Titanium Alloy. You can remove all markup from the index.xml view (the file itself must be there!) and then create another controller based on your logic.
/* /Resources/app.js - Generated by Alloy, here to understand the flow */
var Alloy = require("alloy"), _ = Alloy._, Backbone = Alloy.Backbone;
Alloy.createController("index");