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((req, res) => { | |
| res.writeHead(200, {'Content-Type': 'text/html'}); | |
| res.write('<h1>Hello, world!</h1>'); | |
| res.end(); | |
| }); | |
| const port = process.env.PORT || 3000; | |
| server.listen(port, () => { | |
| console.log(`Server running at http://localhost:${port}`); |
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
| from diagrams import Diagram, Cluster | |
| from diagrams.k8s.compute import Deployment, Pod | |
| from diagrams.k8s.network import Service | |
| from diagrams.k8s.rbac import RoleBinding | |
| from diagrams.onprem.client import User | |
| from diagrams.onprem.database import PostgreSQL | |
| with Diagram("KubernetesAdvanced", show=False): | |
| with Cluster("Cluster"): | |
| svc = Service("Service") |
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
| from diagrams import Diagram, Cluster | |
| from diagrams.k8s.compute import Deployment, Pod | |
| from diagrams.k8s.network import Service | |
| with Diagram("KubernetesSimple", show=False): | |
| with Cluster("Cluster"): | |
| svc = Service("Service") | |
| with Cluster("Pods"): | |
| pods = [Pod("Pod1"), Pod("Pod2")] | |
| svc >> pods |
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
| # Configure the AWS provider | |
| provider "aws" { | |
| region = "us-east-1" | |
| } | |
| # Create a security group to allow inbound traffic to the EC2 instance | |
| resource "aws_security_group" "web" { | |
| name_prefix = "web-sg-" | |
| ingress { | |
| from_port = 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
| // SPDX-License-Identifier: MIT | |
| pragma solidity ^0.8.9; | |
| contract BaseContract { | |
| } | |
| contract MyLib { | |
| uint myValue; |
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
| <?xml version="1.0" encoding="UTF-8"?> | |
| <testsuites duration="1"> | |
| <testsuite failures="0" name="My test suite 1" package="My package 1" tests="3" time="0.6"> | |
| <testcase classname="my_class1" name="My class 1" time="0.1"/> | |
| <testcase classname="my_class2" name="My class 2" time="0.2"/> | |
| <testcase classname="my_class3" name="My class 3" time="0.3"/> | |
| </testsuite> | |
| <testsuite failures="1" name="My test suite 2" package="My package 2" tests="1" time="0.4"> | |
| <testcase classname="My class2" name="My class 2" time="0.4"/> | |
| </testsuite> |
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
| var express = require('express'); | |
| var bodyParser = require('body-parser'); | |
| var cookieParser = require('cookie-parser'); | |
| var session = require('express-session'); | |
| var csrf = require('csurf'); | |
| var app = express(); | |
| var SERVER_PORT = 5555; | |
| app.use(bodyParser.urlencoded({ extended: true })); |
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
| var express = require('express'); | |
| var SERVER_PORT = 1111; | |
| var DATA = { | |
| '1': {'contact': 'John Doo'}, | |
| '2': {'contact': 'Paul John'} | |
| }; | |
| function handleCors (req, res, next) { |
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
| <!DOCTYPE html> | |
| <html> | |
| <body onload="getData()"> | |
| <div id="output"></div> | |
| <script> | |
| function getData() { | |
| var request = new XMLHttpRequest(); | |
| request.open('GET', 'http://127.0.0.1:1111/contacts', true); | |
| request.onerror = function() { |
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
| var express = require('express'); | |
| var SERVER_PORT = 1111; | |
| var DATA = { | |
| '1': {'contact': 'John Doo'}, | |
| '2': {'contact': 'Paul John'} | |
| }; | |
| var server = express(); |
NewerOlder