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 express = require('express'); | |
const app = express(); | |
const dynamicMiddlewareAddition = async (req, res, next) => { | |
const number = Math.round(Math.random() * 100); | |
const isEven = number % 2 === 0; | |
//given a condition, run certain middlewares chained to one another. | |
const middlewares = isEven ? [middleware2] : [middleware1, middleware2, middleware3]; | |
console.log(number, isEven, middlewares); | |
if(middlewares.length >= 1) { |
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
{"lastUpload":"2018-05-17T13:06:04.653Z","extensionVersion":"v2.9.2"} |
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
RM.Event.subscribe(RM.Event.ARTIFACT_SELECTED, onSelection); | |
var self = this; | |
var stringXml = []; | |
function onSelection(artifactArray) { | |
RM.Data.getAttributes( | |
artifactArray, | |
[RM.Data.Attributes.PRIMARY_TEXT], | |
function(opResult) { | |
if (opResult.code !== RM.OperationResult.OPERATION_OK) { |
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
import React, { Component } from 'react' | |
import logo from './logo.svg' | |
import './App.css' | |
import MyForm from './MyForm' | |
class App extends Component { | |
constructor () { | |
super() | |
this.state = {name: 'Paul'} | |
} |
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
import React, {Component} from 'react' | |
import {BrowserRouter, Switch, Route} from 'react-router-dom' | |
import Setup from '../pages/Setup' | |
import Routes from '../routes' | |
class App extends Component { | |
constructor (props) { | |
super(props) | |
this.state = {setup: true} // assume true first... | |
} |
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
// Fill out your copyright notice in the Description page of Project Settings. | |
#include "Jack.h" | |
#include "Pad.h" | |
// Sets default values | |
APad::APad() | |
{ | |
// Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it. |
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 Sequelize = require("sequelize"); | |
var sequelize = new Sequelize('myDatabase', 'root', '', { | |
host: 'localhost', | |
dialect: 'mysql', | |
pool: { | |
max: 5, | |
min: 0, | |
idle: 10000 |