This file contains hidden or 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
var Promise = require('bluebird'); | |
Promise.promisifyAll(City); // creates copies of every function with "Async" suffix... each return a promise | |
Promise.promisifyAll(Category); | |
Promise.all([ | |
City.getAsync(0), | |
Category.getAsync(0) | |
]).then(function (responses) { | |
var cityResponse = responses[0]; |
This file contains hidden or 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
var express = require('express') | |
, jwtMiddleware = require('express-jwt') | |
, bodyParser = require('body-parser') | |
, cookieParser = require('cookie-parser') | |
, cors = require('cors'); | |
// We pass a secret token into the NodeJS process via an environment variable. | |
// We will use this token to sign cookies and JWTs | |
var SECRET_TOKEN = process.env.SECRET_TOKEN; |
This file contains hidden or 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
#!/usr/bin/env node | |
var axios = require('axios'); | |
var args = require('yargs').argv; | |
function help () { | |
process.stdout.write(` | |
This command line utility is used to get the next active target code for blue/green deployments on docker cloud.\n | |
Usage: | |
./getNextTargetCode | |
--user=[username] Docker cloud username. |
This file contains hidden or 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
var files = [ | |
'javascript/foo.js', | |
'css/bar.css', | |
'images/hello.png', | |
'images/world.jpg' | |
]; | |
var fileSends = files.map(function (filePath) { | |
//Loops over files, passing in file[index] as filePath | |
//It returns a new array based on whatever is returned from each function call |
This file contains hidden or 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
var files = [ | |
'javascript/foo.js', | |
'css/bar.css', | |
'images/hello.png', | |
'images/world.jpg' | |
]; | |
var fileSends = files.map(function (filePath) { | |
//Loops over files, passing in file[index] as filePath | |
//It returns a new array based on whatever is returned from each function call |
This file contains hidden or 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
{ | |
"data": [ | |
{ | |
"value": 1 | |
}, | |
{ | |
"value": 2 | |
}, | |
{ | |
"value": 3 |
This file contains hidden or 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 strict'; | |
angular.module('console').factory('Employer', function(DS, $rootScope){ | |
var store = DS.defineResource({ | |
name: 'Employer', | |
idAttribute: 'guid', | |
endpoint: '/employers', | |
keepChangeHistory: true, | |
schema: { | |
name: 'string', |
This file contains hidden or 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
angular.module('foo').directive('fileUpload', function($event){ | |
return { | |
restrict: 'E', | |
scope: { | |
uploadEvent: '=' | |
}, | |
template: '<input type="file" style="display: inline-block; height: 100%; width: 100%"></input>', | |
link: function(scope, element){ | |
var input = element.find('input'); | |
element.css('display', 'inline'); //make sure the element itself behaves like an input visually so |
This file contains hidden or 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
/** | |
* iOS 6 style switch checkboxes | |
* by Lea Verou http://lea.verou.me | |
*/ | |
:root input[type="checkbox"] { /* :root here acting as a filter for older browsers */ | |
position: absolute; | |
opacity: 0; | |
} |
This file contains hidden or 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
var fooList = function(){ | |
var self = this, | |
data = []; | |
self.add = function(name){ | |
data.push(name); | |
}; | |
self.clearDeep = function(){ |