This file contains hidden or 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
| 🐋️ ~ kubectl apply -f . | |
| Pod | |
| 🐋️ ~ kubectl describe pod webapp | |
| 🐋️ ~ kubectl port-forward webapp 8080:80 | |
| Service | |
| 🐋️ ~ kubectl describe svc fleetman-webapp | |
| 🐋️ ~ kubectl port-forward service/fleetman-webapp 8080:80 |
This file contains hidden or 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
| Install SDK | |
| Install Java | |
| sdk list java | |
| sdk install java <candidate> | |
| sdk use java <candidate> | |
| sdk default java <candidate> | |
| Install Scala |
This file contains hidden or 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 './App.css'; | |
| import Person from './Person/Person'; | |
| class App extends Component { | |
| state = { | |
| persons: [ | |
| { name: 'Max', age: 28 }, | |
| { name: 'Manu', age: 29 }, | |
| { name: 'Step', age: 26 } |
This file contains hidden or 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
| npm install -s express | |
| npm install -s morgan chalk | |
| npm install nodemon -g | |
| //Requires | |
| const express = require('express'); | |
| const app = express(); | |
| const path = require('path'); | |
| const chalk = require('chalk'); |
This file contains hidden or 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
| //pulser.js | |
| const Pulser = require('./index.js') | |
| const pulser = new Pulser(); | |
| pulser.on('first emitted', () => { | |
| console.log(`${new Date().toISOString()} pulse first received`); | |
| }); | |
| pulser.on('second emitted', () => { | |
| console.log(`${new Date().toISOString()} pulse second received`); |
This file contains hidden or 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
| function doSomethingWithACallback( | |
| initialText: string, | |
| callback : (initialText: string) => void | |
| ) { | |
| console.log(`inside doSomethingWithCallback ${initialText}`); | |
| callback(initialText); | |
| } | |
| function callbackFunction(text: string) { | |
| console.log(`inside callbackFunction ${text}`); |
This file contains hidden or 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 util = require('util'); | |
| const url = require('url'); | |
| const timestamp = () => { return new Date().toISOString(); } | |
| exports.sniffOn = function(server) { | |
| server.on('request', (req, res) => { | |
| console.log(`${timestamp()} e_request`); | |
| console.log(`${timestamp()} ${reqToString(req)}`); | |
| }); |
This file contains hidden or 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 util = require('util'); | |
| const url = require('url'); | |
| const os = require('os'); | |
| const server = http.createServer(); | |
| server.on('request', (req, res) => { | |
| var requrl = url.parse(req.url, true); | |
| if (requrl.pathname === '/') { | |
| res.writeHead(200, {'Content-Type': 'text/html'}); |
This file contains hidden or 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 server = http.createServer(); | |
| server.on('request', (req, res) => { | |
| res.writeHead(200, {'Content-Type': 'text/plain'}); | |
| res.end('Hello, World!\n'); | |
| }); | |
| server.listen(8124, '127.0.0.1'); | |
| console.log('Server running at http://127.0.0.1:8124'); |
This file contains hidden or 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
| # baseball is available as a regular list of lists | |
| # Import numpy package | |
| import numpy as np | |
| # Create a 2D numpy array from baseball: np_baseball | |
| np_baseball = np.array(baseball) | |
| # Print out the shape of np_baseball | |
| print(np_baseball.shape) |
NewerOlder