Skip to content

Instantly share code, notes, and snippets.

🐋️ ~ 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
Install SDK
Install Java
sdk list java
sdk install java <candidate>
sdk use java <candidate>
sdk default java <candidate>
Install Scala
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 }
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');
//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`);
function doSomethingWithACallback(
initialText: string,
callback : (initialText: string) => void
) {
console.log(`inside doSomethingWithCallback ${initialText}`);
callback(initialText);
}
function callbackFunction(text: string) {
console.log(`inside callbackFunction ${text}`);
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)}`);
});
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'});
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');
# 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)