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
ALGOLIA_APP_ID= | |
ALGOLIA_ADMIN_API_KEY= | |
ALGOLIA_INDEX_NAME= | |
AIRTABLE_API_KEY= | |
AIRTABLE_BASE_ID= | |
AIRTABLE_TABLE_NAME= | |
GITHUB_PERSONAL_ACCESS_TOKEN= |
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
lkjlklkj |
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
/* | |
Programmatic Mocha code - This is used by a codeship | |
test to both start an expressjs app, setup routes and | |
run a suite of mocha tests. | |
Hint: Place this in the root of the project. Call from | |
test package.js or setup with > node mocha.js | |
Also see: https://gist.github.com/d1b1/7949456 (Expressjs + Swagger App) |
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); |
NewerOlder