1.) Download a Nerd Font
2.) Unzip and copy to ~/.fonts
3.) Run the command fc-cache -fv
to manually rebuild the font cache
const { devices, firefox, chromium } = require('playwright'); | |
(async () => { | |
const browser = await chromium.launch({headless: false}); | |
const context = await browser.newContext({ | |
permissions: ['geolocation', 'microphone', 'camera'], | |
colorScheme: 'dark', | |
recordVideo: { | |
dir: 'videos/', | |
size: { width: 1920, height: 1080 }, | |
} |
// haversin(θ) function | |
func hsin(theta float64) float64 { | |
return math.Pow(math.Sin(theta/2), 2) | |
} | |
// Distance function returns the distance (in meters) between two points of | |
// a given longitude and latitude relatively accurately (using a spherical | |
// approximation of the Earth) through the Haversin Distance Formula for | |
// great arc distance on a sphere with accuracy for small distances | |
// |
1.) Download a Nerd Font
2.) Unzip and copy to ~/.fonts
3.) Run the command fc-cache -fv
to manually rebuild the font cache
#gstreamer mixer
gst-launch-1.0 -e \
videomixer name=mix background=1 \
sink_1::xpos=0 sink_1::ypos=0 \
sink_2::xpos=200 sink_2::ypos=0 \
sink_3::xpos=0 sink_3::ypos=100 \
sink_4::xpos=200 sink_4::ypos=100 \
! autovideosink \
//Self-Signed Certificate for using with VS Code Live Server | |
//Save both files in a location you will remember | |
1. create a private key | |
openssl genrsa -aes256 -out localhost.key 2048 | |
// you will be prompted to provide a password | |
//this will create localhost.key (call it whatever you like) | |
2. create the certificate |
document.getElementById("btn").onclick = async () => { | |
await run(); | |
} | |
async function run() { | |
let stream = await navigator.mediaDevices.getUserMedia({ video: true, audio: false }); | |
/* sender */ | |
let sender = new RTCPeerConnection(); | |
sender.onicecandidate = e => receiver.addIceCandidate(e.candidate); |
Caddy is ready to serve your site over HTTPS: | |
Point your domain's A/AAAA DNS records at this machine. | |
Upload your site's files to /var/www/html. | |
Edit your Caddyfile at /etc/caddy/Caddyfile: | |
Replace :80 with your domain name | |
Change the site root to /var/www/html | |
Reload the configuration: systemctl reload caddy | |
Visit your site! |
FROM golang:1.6.2 | |
COPY . /go | |
RUN go get github.com/nats-io/nats | |
RUN go build api-server.go | |
EXPOSE 8080 | |
ENTRYPOINT ["/go/api-server"] |
httpsServer := &http.Server{ | |
Handler: http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { | |
hj, isHJ := w.(http.Hijacker) | |
if r.Header.Get("Upgrade") == "websocket" && isHJ { | |
c, br, err := hj.Hijack() | |
if err != nil { | |
log.Printf("websocket websocket hijack: %v", err) | |
http.Error(w, err.Error(), 500) | |
return | |
} |