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
//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); |
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 | |
} |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<title> </title> | |
<link rel="stylesheet" type="text/css" href="http://cdn.jsdelivr.net/min/1.5/min.min.css"> | |
<style> | |
body,textarea,input,select { | |
background:0; | |
border-radius:0; | |
font:16px sans-serif; |
func openbrowser(url string) { | |
var err error | |
switch runtime.GOOS { | |
case "linux": | |
err = exec.Command("xdg-open", url).Start() | |
case "windows": | |
err = exec.Command("rundll32", "url.dll,FileProtocolHandler", url).Start() | |
case "darwin": | |
err = exec.Command("open", url).Start() |