Typescript, Jest and ECMAScript Modules (ESM)
Package.json
Add the type
property to package.json
to ensure modules are supported:
{
"type": "module",
}
Add the type
property to package.json
to ensure modules are supported:
{
"type": "module",
}
/* | |
* Libevent is a high-performance and portable asynchronous networking I/O library (http://libevent.org) | |
* This is small program to demonstrate the basic of libevent programming | |
* | |
* Copyright (C) 2012, Ardhan Madras <ardhan@rocksis.net> | |
*/ | |
#include <event.h> | |
#include <arpa/inet.h> | |
#include <netinet/in.h> |
"use strict"; | |
const _ = require("lodash"); | |
const chalk = require("chalk"); | |
const Promise = require("bluebird"); | |
const ServiceBroker = require("../src/service-broker"); | |
const { MoleculerError } = require("../src/errors"); | |
// --- SAGA MIDDLEWARE --- | |
const SagaMiddleware = function() { |
// Not only Object but also other types. (Function, Array, String, Number, ...)
Object.prototype.prop1 = 1;
Object.prototype.func1 = () => 'Hello!';
const obj1 = {};
<html> | |
<head> | |
<script type="text/javascript" src="/jquery.min.js"></script> | |
<title>Mime type checker</title> | |
<script> | |
$(function () { | |
var result = $('div#result'); | |
if (window.FileReader && window.Blob) { | |
$('span#submit').click(function () { | |
var files = $('input#file').get(0).files; |
This Dockerfile is intended for SvelteKit applications that use adapter-node.
FROM node:16-alpine AS builder
WORKDIR /app
COPY package*.json .
RUN npm ci
COPY . .
RUN npm run build
apiVersion: v1 | |
kind: ConfigMap | |
metadata: | |
name: pihole-config | |
data: | |
WEBPASSWORD: pihole | |
TZ: 'Asia/Ho_Chi_Minh' | |
DNS1: 1.1.1.1 | |
DNS2: 1.0.0.1 |
apiVersion: v1 | |
kind: Pod | |
metadata: | |
name: ubuntu | |
labels: | |
app: ubuntu | |
spec: | |
containers: | |
- image: ubuntu | |
command: |
kubectl delete "$(kubectl api-resources --namespaced=true --verbs=delete -o name | tr "\n" "," | sed -e 's/,$//')" --all |
Today I tried to setup a small Kubernetes cluster on top of 3 Raspberry Pi 4 (4GB Memory). Here is the steps to install the cluster.
I have 3 Raspberry Pi 4 stacked with PoE headers and connected to a PoE switch at home. The are connected to Internet through a home router. All Pis are equipped with a 64GB Samsung SDXC card flushed with Ubuntu 20.04 image.