Skip to content

Instantly share code, notes, and snippets.

View aaronksaunders's full-sized avatar

Aaron K Saunders aaronksaunders

View GitHub Profile

This is an example of how to scaffold API endpoints to list / get / create / update / delete Posts in a Keystone website.

It's a modification of the default project created with the yo keystone generator (see https://github.com/JedWatson/generator-keystone)

Gists don't let you specify full paths, so in the project structure the files would be:

routes-index.js        -->    /routes/index.js         // modified to add the api endpoints
routes-api-posts.js    -->    /routes/api/posts.js     // new file containing the Post API route controllers
config.json
reading-image.png
@aaronksaunders
aaronksaunders / snippet.js
Last active August 29, 2015 14:12
Saving custom object with photo in Appcelerator Cloud Services with Angular JS
//
// Angular JS documentation on $http Service
// https://docs.angularjs.org/api/ng/service/$http
//
// Referenced Blog Post
// http://uncorkedstudios.com/blog/multipartformdata-file-upload-with-angularjs
//
// Appcelerator Cloud Services Documentation - Photos & Custom Objects
// http://docs.appcelerator.com/cloud/latest/#!/api/Photos
// http://docs.appcelerator.com/cloud/latest/#!/api/CustomObjects
@aaronksaunders
aaronksaunders / 1) instructions.md
Last active August 29, 2015 14:12
Packaging up an Angular JS App to Run in Node.ACS Environment from Appcelerator

Deploying an AngularJS Application to node.acs

###Follow the instructions below these instructions assume you used Grunt to create the basic project structure and are packaging the app for deployment using grunt build:dist

  1. Enter the grunt command to build the application from project root grunt build:dist

  2. Enter the following commands to copy needed files to dist directory, this assumes you placed them in a folder called acs_deploy

//
// Project-Bridging-Header.h
// networkingtestApp
//
// Created by Aaron Saunders on 10/31/14.
// Copyright (c) 2014 Aaron Saunders. All rights reserved.
//
#ifndef networkingtestApp_Project_Bridging_Header_h
#define networkingtestApp_Project_Bridging_Header_h
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.min.js"></script>
<script src="http://www.parsecdn.com/js/parse-1.2.12.min.js"></script>
<meta charset=utf-8 />
<title>Example</title>
</head>
<body ng-app="AuthApp">
<div ng-hide="currentUser">
@aaronksaunders
aaronksaunders / gist:389b209cf9499b0b1a86
Created August 3, 2014 16:35
[Appcelerator Titans] Auto increment <version> in tiapp.xml
From:
Chris Barber <[email protected]>
To:
"[email protected]" <[email protected]>,
"[email protected]" <[email protected]>,
Date:
04/09/2014 01:21 AM
Subject:
Re: [Appcelerator Titans] Auto increment <version> in tiapp.xml
$.getView().open();
// set the sync adapter
Alloy.Backbone.sync = function(method, model, opts) {
require("alloy/sync/properties").sync(method, model, opts);
};
// createing a model now just requires the collection_name field
function createCountryModel(_collection_name) {
@aaronksaunders
aaronksaunders / userService.js
Created July 27, 2014 17:34
Work In Progress, full blog post forthcoming - UserService for Firebase and IonicFramework App I am working - Aaron Saunders Clearly Innovative Inc - http://www.clearlyinnovative.com/blog/post/tag/ionic-framework
// UserService.js
//
// Aaron K Saunders
// Clearly Innovative Inc
//
// http://www.clearlyinnovative.com/blog/post/tag/ionic-framework
//
/*global Firebase*/
(function(angular) {
'use strict';
@aaronksaunders
aaronksaunders / app.js
Last active August 29, 2015 14:03
Appcelerator Cloud Services, Promises and Custom Objects
//
//
var Q = require('q'); // add q.js library - https://github.com/kriskowal/q
var Cloud = require("ti.cloud"); // add in tiapp.xml
Cloud.debug = true;
function cloudCreateObjects(_data) {
var deferred = Q.defer();