Skip to content

Instantly share code, notes, and snippets.

@lbrenman
lbrenman / arrowProjectNotes.md
Last active June 11, 2018 11:50
Arrow Builder coding notes, tips and tricks

Arrow Builder coding notes, tips and tricks

  • Create a new project using:

    appc new
  • For npm's required in your project, you need to do the following:

    • "sudo npm install " for running locally OR add to package.json -> devDependencies section
@lbrenman
lbrenman / README.md
Created July 22, 2015 21:21
Appcelerator PDF Viewer Demo
@lbrenman
lbrenman / Account.js
Created May 7, 2015 14:21
Appcelerator Arrow Double Post Block to add GPS coordinates and Local Coffee Shops (via Foursquare) to the Salesforce Account
var Arrow = require("arrow");
var Model = Arrow.Model.reduce("appc.salesforce/Account","Account",{
"fields": {
"Name": {
"type": "string",
"description": "Account Name",
"readonly": false,
"maxlength": 255,
"required": true,
@lbrenman
lbrenman / SalesByRegion.js
Created May 23, 2015 21:44
Appcelerator Arrow Totals Row and KPI Calculation using custom field and getter and a block
var Arrow = require("arrow");
var Model = Arrow.Model.reduce("appc.mysql/table1","SalesByRegion",{
"fields": {
"rid": {
"type": "number",
"required": false,
"optional": true,
"readonly": false,
"writeonly": false
@lbrenman
lbrenman / README.md
Last active December 3, 2017 11:44
Arrow Authentication Scheme Example - Multiple API Keys

#Arrow Authentication Scheme

https://gist.github.com/lbrenman/f884ea1f43d75ed98deb

*Using Basic APIKey Authentication provides a single key for all users of the API

  • What if want to provide a different API Key for different users/customers
  • this is an API Management feature
  • Today, we don’t support this but it can easily be built using Arrow Authentication Scheme
  • Further, ArrowDB can be used to store the users and their keys for authentication
  • Then, access to the API can use different keys (passed in a header) and the user API can use a separate private key that only the admin/Arrow project developer knows
@lbrenman
lbrenman / MyUser.js
Last active November 27, 2017 23:10
Appcelerator Arrow Two Factor Authentication
var Arrow = require("arrow");
var Model = Arrow.createModel("MyUser",{
"fields": {
"username": {
"type": "String",
"required": true
},
"password": {
"type": "String",
@lbrenman
lbrenman / fbwebhook.js
Last active October 31, 2017 15:37
Hello API Builder FB Chatbot
var Arrow = require('arrow');
var fbwebhook = Arrow.API.extend({
group: 'webhooks',
path: '/api/fbwebhook',
method: 'GET',
description: 'this is an api that shows how to handle requests from the FB chatbot',
parameters: {
'hub.mode': {
description: 'hub.mode',
@lbrenman
lbrenman / fbwebhook.js
Last active August 3, 2017 02:36
API Builder Facebook Chat Bot (Echo)
var Arrow = require('arrow');
var fbwebhook = Arrow.API.extend({
group: 'webhooks',
path: '/api/fbwebhook',
method: 'GET',
description: 'this is an api that shows how to handle requests from the FB chatbot',
parameters: {
'hub.mode': {
description: 'hub.mode',
@lbrenman
lbrenman / _readme
Last active April 19, 2017 22:28
Appcelerator Titanium ti-mocha simple titanium example
Titanium has no built in Unit Test as Xcode/ObjC and Android Java have
Jasmine and Ti-mocha are the two main unit test frameworks for titanium
Jasmine runs without requiring the app to run
Ti-mocha runs while the app is running
Using T-Mocha
@lbrenman
lbrenman / README.md
Last active March 15, 2017 16:28
Arrow Web Scraping Example using x-ray

Arrow Web Scraping

Web scraping is technique of extracting information from websites. For mobile applications, it should be considered a last resort. Instead try to get access to the inderlying data via a documented REST web service API.

However, you may find that an REST or SOAP API is not available and you may need to web scrape in order to get the web site data into your mobile application.

If you are going web scrape, then don't do it in the mobile app. Instead, use a microservices platform, like Arrow. By implementing the screen scraping in an Arrow middle tier server, then when the web site changes, you can change your scraping algorithm without needing to publish a new mobile application.

This blog post will show a simple example of using Arrow Builder to build an API that utilizes web scraping.