전체 새로 만들기

user:thomas 사용자가 만든 gist

title:mygist 주어진 제목의 gist

description:sync 주어진 설명의 gist

filename:myfile.txt 주어진 파일 이름을 가진 gist

extension:yml 주어진 확장자를 가진 gist

language:go 주어진 언어를 가진 gist

topic:homelab 주어진 토픽의 gist

all:systemctl 모든 필드 검색

로그인

전체 새로 만들기 로그인

모든 gist

최신 순 생성일
오래된 순 생성일
최신 순 수정일
오래된 순 수정일

mila / cue-mod-switch.sh

0 좋아요
0 포크
1 파일
마지막 활동 4 weeks ago
1 #!/bin/bash
2
3 set -euo pipefail
4
5 CUE_MODULES_DIR=$HOME/workspace/cue-workspace/publish
6
7 switch_to_pkg() {
8 startdir=$PWD
9 for dep in $(cue export -e deps cue.mod/module.cue | yq -o tsv '. | keys'); do
10 name=$(echo "$dep" | cut -d@ -f1)

mila / http handler metrics wrapper

0 좋아요
0 포크
1 파일
마지막 활동 4 weeks ago
1 import "github.com/felixge/httpsnoop"
2
3 handler := http.StripPrefix("/path/", http.FileServer(http.Dir("/tmp/files/")))
4
5 wrappedHandler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
6 metrics := httpsnoop.CaptureMetrics(handler, w, r)
7 slog.Info(fmt.Sprintf("%v %v", r.Method, r.URL), "code", metrics.Code)
8 })

mila / print json

0 좋아요
0 포크
1 파일
마지막 활동 4 weeks ago
1 //lint:ignore U1000 (dev-only)
2 func printJSON(i interface{}, prefix ...string) {
3 pre := fmt.Sprintf("%T>>>", i)
4 if len(prefix) == 1 {
5 pre = prefix[0] + ">"
6 }
7 data, err := json.MarshalIndent(i, pre+" ", " ")
8 if err != nil {
9 panic(err)
10 }
다음 항목 이전 항목

Opengist의 지원을 받고 있습니다 ⋅ Load: 70ms⋅

한국어
العربية Čeština Deutsch English Español Français Magyar Italiano 日本語 한국어 Polski Português Русский Türkçe Українська 简体中文 繁體中文