Skip to content

Instantly share code, notes, and snippets.

@sunary
sunary / script.js
Created January 10, 2021 08:59
prevent redirect web
window.onbeforeunload = function(){ return 'Leave page?'; };
@sunary
sunary / principles.md
Last active October 6, 2021 00:44
Design Principles

Design principles applicable to many areas of computer systems:

Adopt sweeping simplifications

So you can see what you are doing.

Avoid excessive generality

If it is good for everything, it is good for nothing.

Avoid rarely used components

Deterioration and corruption accumulate unnoticed—until the next use.

@sunary
sunary / devops_best_practices.md
Created July 18, 2023 06:25 — forked from jpswade/devops_best_practices.md
Devops Best Practices Checklist

Find the original here article here: Devops Best Practices

DevOps started out as "Agile Systems Administration". In 2008, at the Agile Conference in Toronto, Andrew Shafer posted an offer to moderate an ad hoc "Birds of a Feather" meeting to discuss the topic of "Agile Infrastructure". Only one person showed up to discuss the topic: Patrick Debois. Their discussions and sharing of ideas with others advanced the concept of "agile systems administration". Debois and Shafer formed an Agile Systems Administrator group on Google, with limited success. Patrick Debois did a presentation called "Infrastructure and Operations" addressing

@sunary
sunary / aes256.go
Last active August 4, 2023 09:04
aes256 CBC & CFB
package main
import (
"bytes"
"crypto/aes"
"crypto/cipher"
"crypto/rand"
"crypto/sha256"
"encoding/base64"
"errors"
@sunary
sunary / main.go
Created March 31, 2025 07:58
golang-MCP-gemini
package main
import (
"context"
"flag"
"fmt"
"log"
"github.com/google/generative-ai-go/genai"
"github.com/mark3labs/mcp-go/mcp"