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
// respond variable was given before | |
function displayContent(attrName, lang) { | |
const valid_attrs = ["title", "abstract"] | |
const valid_langs = ["en", "nl", "fr"] | |
// validate attrName and lang before accessing property | |
if (valid_attrs.includes(attrName) && valid_langs.includes(lang)) return respond.data[attrName][lang] | |
return null | |
} |
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 OAUTH2_OPTIONS = { | |
facebookLogin() { | |
// do the oath2 procedure for FB | |
}, | |
googleLogin() { | |
// do the oath2 procedure for google | |
}, | |
instagramLogin() { | |
// do the oath2 procedure for instagram | |
} |
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
{ | |
"data": { | |
"GetTodosAsAssignee": [ | |
{ | |
"id": 7, | |
"report_id": 64, | |
"text": "do the dishes", | |
"status": "awaiting", | |
"assignee": [ |
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
[ | |
{ | |
"logo": "https://www.car-logos.org/wp-content/uploads/2011/09/abarth1.png", | |
"name": "Abarth" | |
}, | |
{ | |
"logo": "https://www.car-logos.org/wp-content/uploads/2011/09/ac-cars.png", | |
"name": "AC" | |
}, | |
{ |
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 strict'; | |
module.exports = async function(createSequelizeInstance, log) { | |
const { Sequelize, Op, Model, DataTypes } = require('sequelize'); | |
const sequelize = createSequelizeInstance({ benchmark: true }); | |
await sequelize.authenticate(); | |
const Report = sequelize.define('Report', { | |
name: DataTypes.STRING, |
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
public Startup(IConfiguration configuration) | |
{ | |
Configuration = configuration; | |
StaticConfig = configuration; | |
} | |
public static IConfiguration Env { get; private set; } | |
// to use simply call the static member from anywher in the app | |
// Startup.Env["Jwt:issuer"] |
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
{ | |
"AEAJM": { | |
"name": "Ajman", | |
"city": "Ajman", | |
"country": "United Arab Emirates", | |
"alias": [], | |
"regions": [], | |
"coordinates": [ | |
55.5136433, | |
25.4052165 |
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
{ | |
"error": [ | |
{"message": "Incorrect"} | |
], | |
"status": 400, | |
} |
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 strict' | |
/* | |
* API middleware | |
* | |
* Adds shortcut methods for JSON API responses (inspired by KeystoneJS) : | |
* | |
* `res.apiResponse(data)` | |
* `res.apiError(key, err, msg, code)` | |
* `res.apiNotFound(err, msg)` |
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
socket.on('Room_45IDFDQSDFA', data => { | |
this.setState('messages', this.messages.push(data.message)) | |
}); |