This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
functions.database.ref('/invites/{id}/actions/email').onWrite((event, context) => { | |
const action = event.after.val() | |
// Check if the function has been run. | |
if (!action || action == 'failed' || action == 'completed') return 0 | |
// Use the parent.parent to get to the actual object. | |
return event.after.ref.parent.parent.once('value').then(snap => { | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const git = require('git-rev') | |
const data = require('gulp-data') | |
const pkg = require('./package.json') | |
const template = require('gulp-template') | |
gulp.task('environment', function() { | |
git.branch(function (branch) { | |
git.short(function (commit) { | |
console.log('Setting up configuration for', branch.toUpperCase()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app.run(['$rootScope', '$uibModal'', function($rootScope, $uibModal) { | |
$rootScope.editBoook = function(Book) { | |
var modal = $uibModal.open({ | |
animation: true, | |
templateUrl: 'app/modals/book/edit/page.html', | |
controller: ['$scope', function($scope) { | |
$scope.Book = Book; | |
$scope.cancel = function() { | |
Book.$cancel().then(modal.close); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app | |
.factory('BookFactory', ['$firebaseObject', function($firebaseObject) { | |
return $firebaseObject.$extend({ | |
$cancel: function() { | |
var self = this; | |
return new Promise((resolve, reject) => { | |
self.$ref().once('value', function(d) { | |
var raw = d.val(); | |
_.each(raw, function(v, k) { | |
self[k] = v; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Assumes the Firebase Ref creates a $firebaseArray | |
// Assumes a ui-Router with resolved to get the data. | |
// TODO: Research the ngTableParams for a better way | |
// to trigger changes and watch the array. | |
.state ('plan', { | |
url: '/plan', | |
templateUrl: 'js/routes/plan/tpls/table.html', | |
resolve: { | |
Session: ['Auth', function(Auth) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add the following to a Codeship.io Deployment (Custom) Script. This will update heroku configs with the late CI Run Date and Commit. | |
export CI_RUN_AT=$(date -u +"%Y-%m-%dT%H:%M:%SZ") | |
heroku config:add --app api-thebasicsapp-com LAST_DEPLOYMENT_COMMIT=$CI_COMMIT_ID | |
heroku config:add --app api-thebasicsapp-com LAST_DEPLOYMENT_COMMIT_DATE=$CI_RUN_AT | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Very simple solution to ensure that the path changes each time the Swagger UI is toggled open. This | |
helps speed up testing and fixes. The older version use to support this, but for some reason it was | |
not included in the same way in the new swagger JS. This just binds an changes the URL. | |
*/ | |
setTimeout(function(){ | |
$('.toggleEndpointList, .toggleOperation').on('click', function(data) { | |
window.location = this.href; | |
}); | |
}, 2000); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// GIT Merge | |
// Use this feature to push an local branch 'over' a remote branch. | |
// This is useful when mushing a local release branch into the staging | |
// environment. | |
git push origin localBranch:remoteBranch | |
or | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Seems that parse.com has either neutered a portion of the their stripe.com integration, just decided it is not needed. The docs seem to point to the Stripe.Customers.update(id, token) as the way to add a card (using a token) to a customers account. This works, but only allows a single card. This overwrites the initial card with the new card. Not great. | |
// This should work, but only allows a single card. | |
Stripe.Customers.update(customer, { card: found.get('token') }, | |
function(err, token) { | |
console.log('got here for token'); | |
console.log(token); | |
}); | |
// This works, and seems to point to the need for parse.com to add some work to their backlog. Looks |
NewerOlder