Skip to content

Instantly share code, notes, and snippets.

"devServer": {
"historyApiFallback": true
}
var express = require('express');
var bodyParser = require('body-parser')
var app = express();
var http = require('http').Server(app);
var io = require('socket.io')(http);
var mongoose = require('mongoose');
app.use(express.static(__dirname));
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({extended: false}))
var Message = mongoose.model('Message',{
def setParameters(X, Y, hidden_size):
np.random.seed(3)
input_size = X.shape[0] # number of neurons in input layer
output_size = Y.shape[0] # number of neurons in output layer.
W1 = np.random.randn(hidden_size, input_size)*np.sqrt(2/input_size)
b1 = np.zeros((hidden_size, 1))
W2 = np.random.randn(output_size, hidden_size)*np.sqrt(2/hidden_size)
b2 = np.zeros((output_size, 1))
return {'W1': W1, 'W2': W2, 'b1': b1, 'b2': b2}
const x = 'abc'; // Coerces to true in a boolean context
const y = null; // Coerces to false in a boolean context
// "!" Creates a boolean context and returns the opposite.
const a = !x; // Value a is opposite of x, false.
const b = !y; // Value a is opposite of y, true.
if (a) {
// NOT executed.
}
if (b) {
// Executed.
def process_text(text):
doc = nlp(text.lower())
result = []
for token in doc:
if token.text in nlp.Defaults.stop_words:
continue
if token.is_punct:
continue
if token.lemma_ == '-PRON-'
continue
curl https://5k42947te1.execute-api.eu-central-1.amazonaws.com/production
...
<app-root class="content" _nghost-sc0="" ng-version="6.1.10"><menu _ngcontent-sc0="" _nghost-sc1="">
<ul _ngcontent-sc1="">
<li _ngcontent-sc1=""><a _ngcontent-sc1="" routerlink="firstComponent" href="/production/firstComponent">First component</a></li>
<li _ngcontent-sc1=""><a _ngcontent-sc1="" routerlink="secondComponent" href="/production/secondComponent">Second component</a></li>
</ul>
</menu><router-outlet _ngcontent-sc0=""></router-outlet>
<ng-component><h1>Hello World!</h1></ng-component></app-root>
...
npm run build:serverless:deploy
...
endpoints:
ANY - https://5k42947te1.execute-api.eu-central-1.amazonaws.com/production/{proxy+}
ANY - https://5k42947te1.execute-api.eu-central-1.amazonaws.com/production
functions:
api: angularseo-production-api
...
<app-root class="content" _nghost-sc0="" ng-version="6.1.10"><menu _ngcontent-sc0="" _nghost-sc1="">
<ul _ngcontent-sc1="">
<li _ngcontent-sc1=""><a _ngcontent-sc1="" routerlink="firstComponent" href="/firstComponent">First component</a></li>
<li _ngcontent-sc1=""><a _ngcontent-sc1="" routerlink="secondComponent" href="/secondComponent">Second component</a></li>
</ul></menu>
<router-outlet _ngcontent-sc0=""></router-outlet><ng-component><h1>Hello World!</h1></ng-component></app-root>
...
import { enableProdMode } from '@angular/core';
import { environment } from './environments/environment';
if (environment.production) {
enableProdMode();
}
export {AppServerModule} from './app/app.server.module';
...
"server": {
"builder": "@angular-devkit/build-angular:server
"options": {
"outputPath": "dist/server",
"main": "src/main.server.ts",
"tsConfig": "src/tsconfig.server.json"
}
}
...