Skip to content

Instantly share code, notes, and snippets.

version: '3.8'
services:
notebook:
image: jupyter/base-notebook
user: 0:0
environment:
- GRANT_SUDO=yes
- NB_GID=100
- GEN_CERT=yes
@gocs
gocs / gist:e27c1a6a5bcdb0510f6cd668f4e11850
Created July 14, 2023 04:58
asynchronous fetch requests
let datas = await Promise.all(
[...Array(pages).keys()].map(async i => await export_data(table, query_params, i, options))
);
@gocs
gocs / README.md
Last active January 29, 2025 09:11
ISO 8601 to local and relative datetime plus svelte ticker component

ISO 8601 to local and relative datetime (moment.js alt)

image

@gocs
gocs / .md
Last active February 18, 2025 08:00
Start tmux at Windows Terminal WSL startup

image

Start tmux in Windows Terminal WSL startup

Tmux should already be installed in your system

apt install tmux
@gocs
gocs / main.go
Last active September 20, 2023 04:30
unverified tls wss dial
rootCAs, err := x509.SystemCertPool()
if err != nil {
return nil, err
}
// rootCAs := x509.NewCertPool()
pemData, err := os.ReadFile(certfile)
if err != nil {
return nil, err
}
@gocs
gocs / Dockerfile
Last active March 12, 2024 01:17
dockerized lux (annie)
FROM alpine:latest
WORKDIR /lux
RUN apk add --no-cache \
curl ca-certificates openssl \
perl curl ffmpeg \
tar gzip jq; \
apkArch="$(apk --print-arch)"; Arch=""; \
case "$apkArch" in \
@gocs
gocs / ui.go
Created February 26, 2024 09:29
sample embeded static pages handler
package ui
import (
"embed"
"fmt"
"io/fs"
"net/http"
)
//go:embed all:public
@gocs
gocs / heat.md
Created April 29, 2024 18:38
heat

image

<div class="wrap">
<img src="http://placehold.it/1200/1200" alt="testsetse" />
</div>
<style>
.wrap {
width: 1200px;
height: 1200px;
position: relative;
overflow: hidden;
<script lang="ts">
import { createQrPngDataUrl } from "@svelte-put/qr";
import { onMount } from "svelte";
import JSZip from "jszip";
const qrs = [
];
let srcs: string[] = [];
onMount(async () => {