Skip to content

Instantly share code, notes, and snippets.

View mr-pascal's full-sized avatar

Pascal mr-pascal

View GitHub Profile
################
##### Builder
FROM rust:1.61.0-slim as builder
WORKDIR /usr/src
# Create blank project
RUN USER=root cargo new medium-rust-dockerize
# We want dependencies cached, so copy those first.
enum MyStringEnum {
HELLO = 'HELLO_VALUE',
WORLD = 'WORLD_VALUE'
}
const stringEnumKeys = Object.keys(MyStringEnum);
const stringEnumValues = Object.values(MyStringEnum);
console.log('Keys:');
// Output: [ 'HELLO', 'WORLD' ]
// Create initial buffer
const str = "This is a string";
const buffer = Buffer.from(str, "utf-8");
// Convert buffer back to string
const strFromBuffer = buffer.toString();
// Output: This is a string
console.log(strFromBuffer);
// Original string
const str = "This is a string";
// Create the buffer with "utf-8" encoding
const buffer = Buffer.from(str, "utf-8");
// Output: <Buffer 54 68 69 73 20 69 73 20 61 20 73 74 72 69 6e 67>
console.log(buffer);
apiVersion: apps/v1
kind: Deployment
metadata:
name: myapp
labels:
name: myapp
spec:
selector:
matchLabels:
name: myapp
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx
labels:
name: nginx
spec:
selector:
matchLabels:
name: nginx
apiVersion: v1
kind: ConfigMap
metadata:
name: nginx-cfgmap
data:
file-from-cfgmap: |
<!DOCTYPE html>
<html lang="en">
<head>
<title>From config map</title>
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx
labels:
name: nginx
spec:
selector:
matchLabels:
name: nginx
FROM alpine:3.15.0
CMD ["echo", "Hello Docker!"]
@mr-pascal
mr-pascal / main.go
Last active January 24, 2022 05:42
package main
/**
Import needed modules
*/
import (
"github.com/go-playground/webhooks/v6/github"
"github.com/gofiber/fiber/v2"
"github.com/valyala/fasthttp/fasthttpadaptor"
"log"