Skip to content

Instantly share code, notes, and snippets.

View aaronksaunders's full-sized avatar

Aaron K Saunders aaronksaunders

View GitHub Profile
@aaronksaunders
aaronksaunders / snippet1.js
Created February 19, 2014 17:25
Promise enabled ACS Call to get channels that user is subscribed to with Push Notifications
var Q = require("q");
/**
* gets the list of all of the channels the specified user
* is subscribed to.
*
* this function has been promise enabled using the q libraru
*
* @param {Object} _user - user object from ACS
* @param {Object} _callback - [OPTIONAL] function to call on completion
*
@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, {
@aaronksaunders
aaronksaunders / Google-Map-Directive-in-Ionic.markdown
Last active August 29, 2015 13:57
A Pen by aaron k saunders.

Google Maps Directive in Ionic

trying to use two tabs with a leaflet directive in each one and as soon as the two maps are rendered in the page... everything seems to lock up.

function RateMe(ios_url, goog_url, usecount) {
if(!Ti.App.Properties.hasProperty('RemindToRate')) {
Ti.App.Properties.setString('RemindToRate', 0);
}
var remindCountAsInt = parseInt(Ti.App.Properties.getString('RemindToRate'), 10);
var newRemindCount = remindCountAsInt + 1;
if(remindCountAsInt === -1) {
// the user has either rated the app already, or has opted to never be
// reminded again.

AngularJS Shopping List Widget

AngularJS Shopping List Widget is an AngularJS widget that allows a user to manually enter items of a shopping list, along with prices and coupons, and then print it.

A Pen by Alex Whapham on CodePen.

License.

@aaronksaunders
aaronksaunders / app.js
Created May 17, 2014 03:49
Way too long to figure out how to add post data in $resource in angularjs
angular.module('Ionicgram', ['ionic', 'Ionicgram.controllers', 'Ionicgram.services'])
.run(['$ionicPlatform', '$rootScope', '$state', 'UserService', function ($ionicPlatform, $rootScope, $state, UserService) {
$ionicPlatform.ready(function () {
UserService.login({
login: "admin",
password: "admin_password"
},function(_result){
@aaronksaunders
aaronksaunders / note.md
Last active August 29, 2015 14:01
Why I Wasn't at TiConf NYC 2014

##Why I Wasn't at TiConf

This note is here and not on my company blog because this is personal not about Clearly Innovative

I have been asked a few times why I wasn't at TiConf NYC 2014; the simple answer is because it was made clear... indirectly that I wasn't welcome if I did not buy a ticket and that people involved with the project were upset that I came to a bar where there was a happy hour last year but did not by a ticket.

Let me very clear, I was extrememly dissappointed to hear that a conference that is supposed to be about the community would have that attitude about a community member. I have contributed considerable amount of my personal time and energy to this community. I was actively blogging and supporting the Appcelerator community early on. I have made aquaintances from all around the world where the only place I could have seen them face-to-face was at the conference, but I did not go.

##Why didn't I go.

@aaronksaunders
aaronksaunders / index.html
Created May 23, 2014 21:19
Simple File Upload with Kinvey & AngularJS, more complex example with model and services integration can be found here http://bit.ly/1hv64Xq look in the services.js file
<!DOCTYPE html>
<html>
<head>
<title>Kinvey File Demo</title>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.9/angular.min.js"></script>
<script src="https://da189i1jfloii.cloudfront.net/js/kinvey-angular-1.1.4.min.js"></script>
</head>
<body ng-app="kinveyUploadApp" ng-controller="MainCtrl">
var myApp = angular.module('myApp').service('CordovaNetwork', ['$rootScope', '$ionicPlatform', '$q', function($rootScope, $ionicPlatform, $q) {
// Get Cordova's global Connection object or emulate a smilar one
var Connection = window.Connection || {
'ETHERNET' : 'ethernet',
'WIFI' : 'wifi',
'CELL_2G' : 'cell_2g',
'CELL_3G' : 'cell_3g',
'CELL_4G' : 'cell_4g',
'CELL' : 'cell',
'EDGE' : 'edge',