Skip to content

Instantly share code, notes, and snippets.

@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 / Ticker.svelte
Last active March 11, 2024 09:53
ISO 8601 to local and relative datetime plus svelte ticker component
<script lang="ts">
import { onMount } from "svelte";
import { toAutoLocalDate, toRelativeTime } from "./time";
export let start: string;
let date: string;
onMount(() => {
let interval: number = setInterval(() => {
date = toRelativeTime(start);
@gocs
gocs / .md
Last active February 16, 2024 20:49
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 / .md
Last active August 20, 2023 03:05
angular tailwind template (angular 15)

Angular Tailwind Template

this should work for angular version 12 above

this template will automate the creation process of angular and tailwind as manually instructed here: https://tailwindcss.com/docs/guides/angular

create angular app

@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))
);
version: '3.8'
services:
notebook:
image: jupyter/base-notebook
user: 0:0
environment:
- GRANT_SUDO=yes
- NB_GID=100
- GEN_CERT=yes
@gocs
gocs / .sh
Last active May 25, 2023 07:23
create angular app
# basic
npx -p @angular/cli ng new myappshop
# create angular app in the current directory especially when the current folder is already a git repo
npx -p @angular/cli ng new $(basename "$PWD") --directory=./ --skip-git
# with scss and defaults
npx -p @angular/cli ng new $(basename "$PWD") --directory=./ --skip-git --style=scss --defaults
# with version 16
@gocs
gocs / responsive.html
Created May 21, 2023 09:47
responsive svg
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/8.0.1/normalize.min.css"
@gocs
gocs / .sh
Created May 17, 2023 08:37
basic vite
# fuck you starter pack ICANT ALERT
npm create vite
npm i
npm install -D tailwindcss postcss autoprefixer
npx tailwindcss init -p
npm i jquery
npm i --save-dev @types/jquery