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 server = http.createServer(); | |
server.on('request', (request, response) => { | |
let body = []; | |
request.on('data', (chunk) => { | |
body.push(chunk); | |
}).on('end', () => { | |
body = Buffer.concat(body).toString(); |
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
// ref https://stackoverflow.com/questions/12766528/build-a-function-object-with-properties-in-typescript | |
class Snadbox { | |
public test = Object.assign(() => this.runTest('RUN'), { | |
skip: () => this.runTest('test') | |
}) | |
private runTest = (mode: string) => console.log(`Test in mode ${mode}`); | |
} |
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: echo-server | |
labels: | |
app: echo-server | |
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: apps/v1 | |
kind: Deployment | |
metadata: | |
name: presto-worker | |
labels: | |
app: presto-worker | |
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
const authorize = () => ( | |
target: any, | |
propertyKey: string, | |
) => { | |
let next: any; | |
const getter = () => next; | |
const setter = (old: any) => { | |
next = () => { | |
return old() +1; |
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
#!/bin/sh | |
# Ubuntu 18.05 | |
set -e | |
NODE_ADDRESS=${NODE_ADDRESS:-$(hostname --ip-address)} | |
KUBE_VERSION="1.16.15" | |
KUBE_PACAKGE_VERSION="1.16.15-00" | |
DOCKER_VERSION="18.06.3~ce~3-0~ubuntu" | |
echo "K8S API Addr: $NODE_ADDRESS" |
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 k8s = require("@kubernetes/client-node"); | |
async function run() { | |
const kc = new k8s.KubeConfig(); | |
kc.loadFromDefault(); | |
const appsApi = kc.makeApiClient(k8s.AppsV1Api); | |
const watch = new k8s.Watch(kc); | |
const deploymentCache = new k8s.ListWatch( | |
`/apis/apps/v1/namespaces/default/deployments`, | |
watch, |
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: autoscaling/v2beta1 | |
kind: HorizontalPodAutoscaler | |
metadata: | |
name: test-frontend-1 | |
spec: | |
scaleTargetRef: | |
apiVersion: apps/v1beta2 | |
kind: Deployment | |
name: test-frontend-1 | |
minReplicas: 1 |
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
using System; | |
using System.Collections.Generic; | |
using System.Threading; | |
using System.Threading.Tasks; | |
namespace ConsoleApp1 | |
{ | |
class Program | |
{ | |
static void Main(string[] args) |
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
var SERVERINFO = function () { | |
this.Varsion = 'beta-1.0.1'; | |
this.UploadUrl = 'https://www.adventrip.net/TSSTAREA/Api.php'; | |
this.ImageUrl = 'https:// ..... '; | |
/* | |
寫上其他全域設定 | |
*/ | |
} |
NewerOlder