Skip to content

Instantly share code, notes, and snippets.

@aaronksaunders
aaronksaunders / StrongLoop.js
Created February 22, 2014 19:26
Wrapping StrongLoop to make it play nicer with @appcelerator specifically #tialloy - this is just the first hack at it, still need to address ACLs
exports.definition = {
config : {
adapter : {
type : "restapi",
collection_name : ""
}
},
extendModel : function(Model) {
_.extend(Model.prototype, {
@jasonkneen
jasonkneen / sample.js
Last active August 29, 2015 14:01
DynamicLabel tag in Alloy - allows you to update a "value" and it applies it to a template. Place ui.js in your app/lib folder
$.recordCount.value = 99
@viezel
viezel / build-module-android.sh
Last active August 29, 2015 14:01
Build and copy android module
##
## Build an Appcelerator Android Module
## Then copy it to the default module directory
##
## (c) Napp ApS
## Mads Møller
##
## HOW TO GUIDE
@DaveHudson
DaveHudson / Grunt-Installr
Created July 11, 2014 06:32
Grunt.js + Installr API
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
installr_settings: {
releaseNotes: grunt.file.read("./CHANGELOG.txt")
},
titanium: {
build_ios: { // build for ios first
@kwhinnery
kwhinnery / points.md
Last active August 29, 2015 14:06
iOS Device Sizes for App Developers

[UIScreen mainScreen].bounds.size.height reports the following sizes, in points, for these iOS devices:

iPad Air/Mini/etc. (some require @2x assets)
  • Height: 1024
  • Width: 768
iPhone 6 Plus (401ppi display requires @3x assets)
  • Height: 736
@grantges
grantges / index.js
Last active August 29, 2015 14:06
An example of how to create a SplitWindow for iPad using Appcelerator Mobile SDK (with Alloy MVC Framework)
$.index.addEventListener('visible',function(e){
if (e.view == 'detail'){
e.button.title = "Master";
$.index.detailView.getWindow().leftNavButton = e.button;
} else if (e.view == 'master'){
$.index.detailView.getWindow().leftNavButton = null;
}
});
$.index.open();
@FokkeZB
FokkeZB / index.php
Created September 19, 2014 07:04
Test URL schemes
<?
$scheme = isset($_GET['scheme']) ? $_GET['scheme'] : 'twitter';
$path = isset($_GET['path']) ? $_GET['path'] : '/';
$id = isset($_GET['id']) ? $_GET['id'] : 333903271;
$package = isset($_GET['scheme']) ? $_GET['scheme'] : 'com.twitter.android';
$auto = isset($_GET['auto']);
// Detection
$HTTP_USER_AGENT = strtolower($_SERVER['HTTP_USER_AGENT']);
@grantges
grantges / tiapp.xml
Created September 26, 2014 16:35
iOS 8 Map Module plist requirements
<key>NSLocationAlwaysUsageDescription</key>
<string>
YOUR DESCRIPTOIN GOES HERE - EX. This application would like to use your current location.
</string>
@rborn
rborn / README.md
Last active August 29, 2015 14:23 — forked from manumaticx/README.md

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.

@jedisct1
jedisct1 / Reduce, Kaffeine, NodeJS and Redis
Created March 22, 2011 08:35
Tiny recommendation engine using Map/Reduce, Kaffeine, NodeJS and Redis
sys = require "sys";
http = require "http";
url = require "url";
connect = require "connect";
redis = require "redis";
hashRing = require "hash_ring";
Sharding = {
servers = { "127.0.0.1 10000 6378": 1 };
ring = new hashRing.HashRing servers;