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 { Component } from '@angular/core'; | |
@Component({ | |
selector: 'hello-world', | |
template: ` | |
<h2>Hello World</h2> | |
<p>This is my first component!</p> | |
` | |
}) | |
export class HelloWorldComponent { |
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 http = require('http'); | |
const hostname = '127.0.0.1'; | |
const port = 3000; | |
const server = http.createServer((req, res) => { | |
res.statusCode = 200; | |
res.setHeader('Content-Type', 'text/plain'); | |
res.end('Hello World'); | |
}); |
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
cd /d D:\path\to\mvn_project | |
mvn clean install -DskipTests | |
del D:\path\to\glassfish4\glassfish\domains\domain1\autodeploy\mvn_proj.war_deployed | |
copy /Y D:\path\to\mvn_project\target\mvn_proj.war D:\path\to\glassfish4\glassfish\domains\domain1\autodeploy\ | |
echo "War copied. Please wait until war is deploy..." | |
SET LookForFile="D:\path\to\glassfish4\glassfish\domains\domain1\autodeploy\mvn_proj.war_deployed" | |
:CheckForFile | |
IF EXIST %LookForFile% GOTO FoundIt |
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
cd /path/to/mvn_project | |
mvn clean install -DskipTests | |
rm -rf /path/to/glassfish4/glassfish/domains/domain1/autodeploy/mvn_project.war_deployed | |
cp target/mvn_project.war /path/to/glassfish4/glassfish/domains/domain1/autodeploy/ | |
echo "War copied. Please wait until war is deploy..." | |
while [ ! -f /path/to/glassfish4/glassfish/domains/domain1/autodeploy/mvn_project.war_deployed ]; | |
do | |
sleep 1; | |
done | |
echo "Maven project is deployed now." |
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
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: mongo-express | |
labels: | |
app: mongo-express | |
spec: | |
replicas: 1 | |
selector: | |
matchLabels: |
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
apiVersion: v1 | |
kind: ConfigMap | |
metadata: | |
name: mongodb-configmap | |
data: | |
database_url: mongodb-service |
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
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: mongodb-deployment | |
labels: | |
app: mongodb | |
spec: | |
replicas: 1 | |
selector: | |
matchLabels: |
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
apiVersion: v1 | |
kind: Secret | |
metadata: | |
name: mongodb-secret | |
type: Opaque | |
data: | |
mongo-root-username: dXNlcm5hbWU= | |
mongo-root-password: cGFzc3dvcmQ= |
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 static byte[] toStream(Student stu) { | |
// Reference for stream of bytes | |
byte[] stream = null; | |
// ObjectOutputStream is used to convert a Java object into OutputStream | |
try (ByteArrayOutputStream baos = new ByteArrayOutputStream(); | |
ObjectOutputStream oos = new ObjectOutputStream(baos);) { | |
oos.writeObject(stu); | |
stream = baos.toByteArray(); | |
} catch (IOException e) { | |
// Error in serialization |