Skip to content

Instantly share code, notes, and snippets.

View grantges's full-sized avatar

Bert Grantges grantges

  • Austin, Tx - United States
View GitHub Profile
/**
* Hyperloop Module
* Copyright (c) 2015 by Appcelerator, Inc. and subject to the
* Appcelerator Platform Subscription agreement.
*/
var Hyperloop = require('hyperloop');
var UIView = require('UIView');
var CGRect = require('CGRect');
var CGPoint = require('CGPoint');
/**
* Hyperloop Module
* Copyright (c) 2015 by Appcelerator, Inc. and subject to the
* Appcelerator Platform Subscription agreement.
*/
var Hyperloop = require('hyperloop');
var UIView = require('UIView');
var CGRect = require('CGRect');
var CGPoint = require('CGPoint');
@grantges
grantges / charts.js
Last active November 13, 2017 18:17
Hyperloop Donut Example using Alloy Custom Tags (charts.js should be put in the app/lib folder of your app)
var Hyperloop = require('hyperloop');
var UIView = require('UIView');
var CGRect = require('CGRect');
var CGPoint = require('CGPoint');
var UIColor = require('UIColor');
var UIBezierPath = require('UIBezierPath');
function DEGREES_TO_RADIANS(angle) { return (Number(angle) / 180.0 * Math.PI) };
@grantges
grantges / index.js
Last active June 3, 2016 17:25
Model Extension in Appcelerator Alloy
var modelOne = Alloy.createModel('modelOne');
var modelTwo = Alloy.createModel('modelTwo',{
name: "Bert",
description: "is the man",
URL:"thisisawesome.com"
});
Ti.API.info(modelTwo.config);
modelTwo.save();
@grantges
grantges / Gruntfile.js
Last active November 5, 2015 17:04
Grunt File for Arrow Publishing (credit goes to Fokke for that one)
var child_process = require('child_process'),
async = require('async');
var REGEXP_VERSIONS = /versions: ((?:(?:, )?[0-9]+\.[0-9]+\.[0-9]+)+)\..+currently: ([0-9]+\.[0-9]+\.[0-9]+)/;
module.exports = function(grunt) {
grunt.initConfig({
spawn: {
bump: {
@grantges
grantges / index.js
Created March 19, 2015 17:03
Chaining using Appcelerator Titanium / Alloy (Thanks Jason Kneen!)
Alloy.createController(“login”).on(“submit”, function(e) {
doStuffWith(e)
}).getView().open();
@grantges
grantges / index.js
Created March 18, 2015 15:36
A simple example of how to create a basic Widget using Appcelerator Titanium SDK and Alloy. This widget shows how you can create a cross platform view and external interfaces for programmatically setting properties of the widget.
/**
* UnComment Out this Code to change the properties of your square
$.square.setBackgroundColor("blue");
$.square.setHeight(200);
$.square.setWidth(200)
*/
@grantges
grantges / hbsHelpers.js
Last active August 29, 2015 14:15
Helper Functions for Handlebars Template Engine for use with the Appcelerator Arrow Middleware
/**
* Helper Functions for Handlebars Templating engine
*/
var fs = require('fs')
Arrow = require('arrow'),
watch = require('node-watch');
/**
@grantges
grantges / index.xml
Created January 21, 2015 18:17
Custom TableView Row
<Alloy>
<Window class="container">
<TableView id="myTableView">
<TableViewRow height="100" with="100%">
<View height="100" width="100%" layout="horizontal">
<View id="indicator" borderRadius="12.5" backroundColor="green" height="25" width="25" />
<Label id="myCustomLabel" left="10">
This is a label that may have lots of text in
it, i can do this because i have overwritten the look of the TableViewRow
</Label>
@grantges
grantges / apphooks.js
Last active June 3, 2016 17:26
Appcelerator Titanium - Window Override
/**
* This file would go under the app/lib directory
*/
exports.createWindow = function(params){
var win = Ti.UI.createWindow(params);
win.addEventListener("open", function(e){