01 11 / 2013

New @appxen logo I designed today. Appxen is a PSD to native UI compiler. Coming to a @kickstarter near you soon… #photoshopnotrequired

New @appxen logo I designed today. Appxen is a PSD to native UI compiler. Coming to a @kickstarter near you soon… #photoshopnotrequired

18 10 / 2012

tipm

Titanium package manager.

Installation

 $ npm install -g tipm

Installing packages

To install one or more packages, simply pass their github repo names as arguments to tipm install. Dependencies are resolved and the tipm module contents are downloaded into your apps module/commonjs/ directory by default. View tipm help install for details.

$ tipm install tipm/superagent

   install : tipm/superagent@master
       dep : tipm/events@0.1.0
   install : tipm/events@0.1.0
     fetch : tipm/monglo:tipm-monglo.js
     fetch : tipm/monglo:fs-store.js
     fetch : tipm/events:tipm-events.js
  complete : tipm/superagent
  complete : tipm/events

Searching for module

By adding your tipm module to the TIPM List wiki page it will become automatically available to tipm-search(1). When invoked with no query all tipm modules are displayed, otherwise a filtered search, ordered by the number of github “stars”:

$ tipm search emitter

  tipm/monglo
  url: https://github.com/tipm/monglo
  desc: Portable Pure JS MongoDB
  ★ 12

  tipm/events
  url: https://github.com/tipm/events
  desc: JS Event Emitters
  ★ 10

Usage

Via --help:

Usage: tipm <command> [options]

Options:

  -h, --help     output usage information
  -V, --version  output the version number

Commands:

  install <name ...>      install one or more tipm modules
  create <dir>            create a module skeleton
  search [query]          search with the given query
  info <name> [prop]      output json module information
  changes <name>          output changelog contents
  docs <name>             output readme contents
  open <name>             open module github repo
  ls                      list installed tipm modules

Features

  • write modular commonjs modules
  • write modules that include their own styles, images, scripts, or any combo
  • no registry publishing or account required, uses github repositories
  • extensible sub-commands via tipm-YOURCOMMAND git-style
  • module skeleton creation command
  • installs dependencies from the command-line or ./package.json
  • avoid name squatting through github’s naming conventions
  • build your module with --standalone to share them with non-tipm(1) users
  • view documentation from the command line
  • simple private registry set up (all you need is a file server)
  • very fast

Using Github as a registry

By using GitHub as the registry, tipm(1) is automatically available to you without further explicit knowledge or work creating a registry account etc.

A nice side-effect of this namespaced world is that dependencies are explicit and self-documenting. No longer do you need to query the registry for a “repo” property that may not exist, it’s simply built in to the package name, for example "visionmedia/page.js" rather than the unclear “page”.

Another benefit of this is that there are zero name collisions, for example you may use “tipm/tip” for a dependency of “foo”, and “someuser/tip” as a dependency of “bar”, providing namespaced module names. This prevents obscure or irrelevant naming such as “progress”, “progress2”, “progress-bar”, “progress-module” found in npm.

Creating a tipm Module

The tipm-create(1) command can create a module project skeleton for you by filling out the prompts. Once this repo is published to Github, you’re all done! Note when publishing only publish the files inside the modules version folder. ex. ./tipm-superagent/0.9.6/

$ tipm create jsonstream
repo (username/project): tipm/jsonstream
description: Streaming JSON parser
version (0.0.1): 
author name: Christian Sullivan <cs@euforic.co>
license type (MIT): 
minimum Ti SDK version (2.0.0): 
Ti guid (xxxxxxx-xxxxxx-xxxxxx): 

      create : jsonstream/0.0.1
      create : jsonstream/0.0.1/jsonstream.js
      create : jsonstream/0.0.1/Readme.md
      create : jsonstream/0.0.1/.gitignore
      create : jsonstream/0.0.1/package.json

Manifest

The Titanium commonjs manifest file is automatically generated by tipm(1) when installing the module. So there is no need to publish this to your git repo or manually create. If you wish to create your own just include manifest in the files array of your package.json and it will override the generated manifest

Developing tipm(1) sub-commands

tipm(1) and sub-commands are structured much like git(1), in that sub-commands are simply separate executables. For example $ tipm info pkg and $ tipm-info pkg are equivalent.

Because of this you’ll likely want PATH="./bin:$PATH" in your profile or session while developing tipm, otherwise ./bin/tipm will have a hard time finding the sub-commands.

Running tests

Make sure dependencies are installed:

$ npm install

Then run:

$ make test

TODO

  • Compile native modules
  • All for removing modules
  • Integrate view templates (ax-view)
  • Integrate stylesheet templates (ax-style)

Shout-outs

The concept of tipm themselves are nothing new, Drupal for example has been doing this for years, however it seemed the concept was never really translated to the client. My hope is that other communities will re-implement this simple tool in their language of choice so that we can all consume components easily.

Credits

tipm is based on port of TJ Holowaychuk Component for titanium apps

Components Contributors

  • TJ Holowaychuk
  • Guillermo Rauch
  • Garrett Johnson
  • Amir Abu Shareb
  • Adam Sanderson
  • Matt Mueller
  • Forbes Lindesay
  • Arpad Borsos
  • Dan Williams

License

(The MIT License)

Copyright (c) 2012 Christian Sullivan <cs@euforic.co>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ‘Software’), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED ‘AS IS’, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

12 10 / 2012

Smail

SMS texting API that uses carrier-specific gateways to deliver SMS messages via Sendmail. Zero dependencies or 3rd party APIs required.

Requirements

  • Node.js
  • Sendmail

Installing

$ npm install smail

Usage

// Require the module
var smail = require('smail');

// Message parameters
var options = {
  to: '5554446666',
  from:'5551112222',
  text:'Test SMS from Smail'
  // If you already know the carrier set the optional parameter
  // For a list of carrier names see `lib/providers`
  //carrier:'CARRIER_NAME'
};

// Create new smail instance
var sms = smail(/*Optional option defaults object*/);


// Send the SMS
// Options passed to send will override th default options for the message
sms.send(options,function(err){
  // Do something...
});

Custom Providers List

TODO

Supported Carriers

Carrier list is located in lib/providers - U.S. Providers - Alltel, Ameritech, AT&T Wireless, Boost, CellularOne, Cingular, Edge Wireless, Sprint PCS, Telus Mobility, T-Mobile, Metro PCS, Nextel, O2, Orange, Qwest, Rogers Wireless, US Cellular, Verizon, Virgin Mobile.

License

The MIT License

(Source: euforic.co)

28 9 / 2012

Apic.js - Build Epic API Clients Automatically

Apic.js

Are you tired of writing trivial restful api clients I know I am! apic is a cross-platform automatic api client builder!

Supported Platforms

  • Titanium Mobile
  • Browser
  • Node.js

Schema

The api schema is composed of namespaces, actions, verb, url(optional), path(optional). Overide default action request path by setting the path option. Overide base url by setting the url option.

    var sampleSchema = {
      // Creates _user_ namespace
      user:[
          // Request will result in a get request to `BASE_URL/user/show`
          { action:'show'   , verb:'GET' }

          // Request will result in a put request to `BASE_URL/account/add/new`
        , { action:'create' , verb:'PUT', path:'/account/add/new' }

          // Request will result in delete request to `http://api.adhocurl.com/remove`
        , { action:'remove' , verb:'DELETE' url:'http://api.adhocurl.com' }

          // Request will result in a post request to `http://api.adhocurl.com/member/auth`
        , { action:'login'  , verb:'POST', url:'http://api.adhocurl.com', path:'/member/auth' }
      ]
    , job:[
        { action:'create' , verb:'PUT'    }
      , { action:'update' , verb:'POST'   }
      , { action:'remove' , verb:'DELETE' }
      , { action:'show'   , verb:'GET'    }
      ]
    };

Create w/ Schema

Geneate an API w/ the Provided Schema

    // Create Apic w/ Schema
    var scApic = apic(sampleSchema);

    // Set API's Base Url.
    // If Omitted will default to `'/'`
    scApic.baseUrl = 'http://api.mysite.com';

    ## Add Namespace actions
    Add namespace to Apic api

    // Create new Apic
    var nsApic = apic();

    // Set Base Url
    nsApic.baseUrl = 'http://api.myothersite.com';

    // Add namespace actions
    nsApic.add('product', [
        { action:'create' , verb:'PUT'    }
      , { action:'update' , verb:'POST'   }
      , { action:'remove' , verb:'DELETE' }
    ]);

    // Add another action to namespace
    nsApic.add('product', [{ action:'show'   , verb:'GET' }]);

    // Add more to our schema generated api example
    scApic.add('user', [{ action:'message'   , verb:'POST' }]);

Using you Generated API

    // Generated APIs
    var scApi = myApic.api;
    var nsApi = nsApic.api;

    // Apic Generated APIs

    scApi.user.create('ted' , function(response){
      // Do something with response;
    });

    scApi.job.update({status :'complete'} , function(response){
      // Do something with response;
    });

    scApi.user.message({ id : 007, message:'Api Clients\'s are easy with Apic'} , function(response){
      // Do something with response;
    });

    nsApi.product.create('book' , function(response){
      // Do something with response;
    });

    nsApi.product.show({status :'available'} , function(response){
      // Do something with response;
    });

Permalink 1 note

17 9 / 2012

Rest API Client Generator

Simple cross platform Rest API Client Generator

Developed to help cut down the time it takes to build simple trivial rest api clients

Credit

  • Built with modified version of Superagent to support Titanium
  • Original concept from Bedframe

12 7 / 2012

JS.LA Talk on Titanium MongloDB Shimmy.js PSD2TI

Design to Deploy - Mobile Development with Titanium from JSLA on Vimeo.

20 6 / 2012

On device MongoDB for Titanium Mobile MongoDB style queries Persistence for Collections

MongloDB

13 6 / 2012

Chatty Titanium Logger

Simple remote logging with Balloons.io and Socket.io

app.js

logger.js

07 6 / 2012

Titanium Count.ly SDK Module

Countly is an innovative, real-time, open source mobile analytics application. It collects data from mobile phones, and visualizes this information to analyze mobile application usage and end-user behavior. There are two parts of Countly: the server that collects and analyzes data, and mobile SDK that sends this data (for iOS & Android).

git Repo

05 6 / 2012

Titanium Socket.io-Client

Socket.io-client v9 for titanium mobile

web sockets implemented using Ti-websocket-client

You can find the full gist here Ti.Socket.io.js