Skip to content

Instantly share code, notes, and snippets.

View HazemKhaled's full-sized avatar

Hazem Khaled HazemKhaled

View GitHub Profile
@grantges
grantges / Readme.md
Last active October 31, 2020 20:13
Shapes With Appcelerator Titanium and Hyperloop

Custom Alloy Tags based on Appcelerator Hyperloop modules

With Alloy and Hyperloop, you can quickly and easily expose native UI as Custom Alloy tags by leveraging the namespace (ns) attribute and commonjs modules.

Alloy allows you to create your own UI element that can be included into the XML View heirarchy in one of two ways, an Alloy Widget or through the use of Custom Tags.

To create your own custom tag, you link the tag to the commonjs module with the namespace attribute (ns). Here is an example using a custom tag to render a standard Titanium View:

@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) };
var win = Ti.UI.createWindow({
backgroundColor: "#fff"
});
var btn = Ti.UI.createButton({
title: "Schedule local notification!"
});
btn.addEventListener("click", scheduleLocalNotification);
function scheduleLocalNotification() {
@manumaticx
manumaticx / README.md
Last active July 11, 2020 14:07
Fading ActionBar in Titanium

Fading Actionbar

This is a quick example of how to create a fading actionbar effect like this in Appcelerator Titanium

fadingactionbar

How this works

This is actually very simple. The trick is putting the Actionbar in overlay mode by configuring the theme with windowActionBarOverlay:true. Then all you need to do is updating the color of the Actionbar, in this case by scrolling a ScrollView.

@tegansnyder
tegansnyder / hhvm_magento_setup.md
Last active July 14, 2023 22:30
HHVM Magento Server Setup

I've had the opertunity to try a variety of different server configurations but never really got around to trying HHVM with Magento until recently. I thought I would share a detailed walkthrough of configuring a single instance Magento server running Nginx + Fast CGI + HHVM / PHP-FPM + Redis + Percona. For the purpose of this blog post I'm assuming you are using Fedora, CentOS, or in my case RHEL 6.5.

Please note: I'm 100% open to suggestions. If you see something I did that needs to be done a different way, please let me know. I haven't included my Perconca my.conf file yet. I will shortly. Also I plan on trying this same test with HHVM 3.3 and PHP 7.

Install the EPEL, Webtatic, and REMI repos

rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
rpm -Uvh http://mirror.webtatic.com/yum/el6/latest.rpm
@FokkeZB
FokkeZB / Analytics.md
Last active April 3, 2018 08:20
Options for analytics & crash reports for Titanium apps

Analytics & Crash options for Titanium

Service Analytics Performance Errors Titanium SDK Costs
New Relic Limited (users) HTTP HTTP Incomplete (no crashes) Free, $29/mo
Google Analytics Extensive Manual Native (no traces) Abandoned, Out-dated Free
Appcelerator Platform Extensive HTTP Native + JS Up-to-date Not public
Count.ly Extensive N/A N/A gitTio OSS, $125/mo
Flurry Extensive N/A Native gitTio, Marketplace Free
Crit
@LHIOUI
LHIOUI / tiYoutube.js
Last active April 3, 2018 08:20
Titanium commonJS module to play youtube video on Ti.Media.VideoPlayer many thanks to The Endless Hack https://github.com/endlesshack/youtube-video
//
// tiYoutube.js
//
// Created by Coyote on 2014-10-07.
// Copyright 2014 Coyote. All rights reserved.
//
var YoutubeVideo = function(id, callback) {
var client = Ti.Network.createHTTPClient();
client.onload = function(video_info) {
Ti.API.debug('on load');
@FokkeZB
FokkeZB / DOWNSIZE.md
Last active December 8, 2016 10:39
Automatically generate non-retina and Android images for Alloy projects

UPDATE: With the assets command of the TiCons CLI / Module this can be done even simpeler by calling $ ticons assets or an alloy.ymk using:

task("pre:load", function(event, logger) {
    require('ticons').assets();
});

@jasonkneen
jasonkneen / 1readme.md
Last active May 28, 2021 16:48
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

@ricardoalcocer
ricardoalcocer / index.js
Last active December 16, 2015 16:29
Quick and dirty Appcelerator Alloy + FireFoxOS hack. This sample App works EXACTLY the same on iOS, Android and FirefoxOS.
function onsuccess(data){
var jdata=JSON.parse(data);
var data=[];
jdata.forEach(function(item){
var payload={
tweet:item.text
};
var row=Alloy.createController('tweet.row',payload).getView();