-
Create a unified project
mkdir ~/dev/parentProjectName && \ cd ~/dev/parentProjectName && \ git init && \ git submodule add git@github.com:orgName/projA.git projA && \ git submodule add git@github.com:orgName/projA.git projB
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
var Promise = require('bluebird'); | |
var tests = [ | |
"hell", | |
"hell", | |
"hell", | |
"heaven", | |
"hell" | |
]; |
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
var Promise = require('bluebird'); | |
var a=0, b=0, c=0, d=0, e=0; | |
var tests = [ | |
Promise.delay(5000).then(function(){a++; return Promise.resolve("hell5");}), | |
Promise.delay(1000).then(function(){b++; return Promise.resolve("hell4");}), | |
Promise.delay(3000).then(function(){c++; return Promise.resolve("hell3");}), | |
Promise.delay(2000).then(function(){d++; return Promise.reject("heaven2");}), | |
Promise.delay(1000).then(function(){e++; return Promise.resolve("hell1");}) | |
]; |
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
module.exports = function(app){ | |
var RoleMapping = app.models.RoleMapping; | |
var UserModel = app.models.UserModel; | |
var Role = app.models.Role; | |
RoleMapping.belongsTo(UserModel); | |
UserModel.hasMany(RoleMapping, {foreignKey: 'principalId'}); | |
UserModel.hasMany(Role, {as:'roles', through: RoleMapping, foreignKey: 'principalId'}); | |
Role.hasMany(UserModel, {through: RoleMapping, foreignKey: 'roleId'}); | |
}; |
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
#!/bin/sh | |
#1.0 setup HOST_URL && make sure that HOST_URL is setup | |
export HOST_URL=http://localhost:3000 && echo "HOST_URL=$HOST_URL" | |
#2.0 orgAdminA signs-up | |
export ORG_ADMIN_A=`curl -X POST \ | |
"$HOST_URL/api/1.0/UserModels/signup" \ | |
--header "Content-Type: application/json" \ | |
--header "Accept: application/json" \ |
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
#!/bin/sh | |
# This script is used to read the .env file and setup the enviroment variables for local testing | |
echo "###" | |
echo Its best to invoke this script as: '. ./setenv.sh' rather than './setenv.sh' | |
echo "###" | |
while read kv | |
do | |
key=${kv%%=*} |
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
// References: | |
// https://stackoverflow.com/questions/35113926/change-csv-headers-while-processing-papaparse | |
// https://github.com/mholt/PapaParse/issues/196 | |
// https://github.com/mholt/PapaParse/pull/192/files | |
// https://github.com/mholt/PapaParse/issues/413 | |
beforeFirstChunk: function(chunk) { // replace empty headers with misc. header names | |
var rows = chunk.split( /\r\n|\r|\n/ ); | |
//console.log(rows[0]); | |
var headings = rows[0]; //var headings = '"Item Number","Vend Reorder Number","Description","Item Category","Price-1","Last Cost","Account Code","Attribute-1","","Attribute-2","Attribute-3","Attribute-4","Attribute-5","Attribute-6","Category/Subcategory","Default cost of sale %","Eccomerce Item"," ","Item Type","Long Description","Price Desimal","Quantity Desimal","Regular Price","","Status","Subcategory","Primary Vendor"'; |
NewerOlder