Skip to content

Instantly share code, notes, and snippets.

@alexedwards
alexedwards / cache.go
Last active May 1, 2025 00:58
Generic in-memory cache implementation in Go
package cache
import (
"sync"
"time"
)
// Cache is a basic in-memory key-value cache implementation.
type Cache[K comparable, V any] struct {
items map[K]V // The map storing key-value pairs.
@qoomon
qoomon / conventional-commits-cheatsheet.md
Last active May 1, 2025 00:58
Conventional Commits Cheatsheet

Conventional Commit Messages starline

See how a minor change to your commit message style can make a difference.

Tip

Take a look at git-conventional-commits , a CLI util to ensure these conventions, determine version and generate changelogs

Commit Message Formats

Default

@gappc
gappc / upload_to_digitalocean.sh
Created November 12, 2021 23:22
Bash: upload file to DigitalOcean Spaces (S3 compatible)
# Upload a file to DigitalOcean Spaces (S3 compatible)
# Please note, that the DigitalOcean host is fra1.digitaloceanspaces.com (Frankfurt)
function upload_to_digitalocean() {
SOURCE_FILE_PATH=$1
TARGET_FILE_PATH=$2
BUCKET=$3
RESOURCE="/${BUCKET}/${TARGET_FILE_PATH}"
CONTENT_TYPE="application/x-compressed-tar"
DATE_VALUE=`date -R`
@toy-crane
toy-crane / toss-frontend-rules.mdc
Last active May 1, 2025 00:52
토스 프론트엔드 가이드라인 기반으로 만든 Cursor rule
# Frontend Design Guideline
This document summarizes key frontend design principles and rules, showcasing
recommended patterns. Follow these guidelines when writing frontend code.
# Readability
Improving the clarity and ease of understanding code.
@cr2007
cr2007 / README.md
Last active May 1, 2025 00:38
GNS3 Common Commands
@hurricane-voronin
hurricane-voronin / README.md
Last active May 1, 2025 00:32
Naming Classes Without a 'Manager'
@aanderse
aanderse / configuration.nix
Created September 15, 2024 13:47
htpc setup using kodi on NixOS
{ ... }:
{
imports = [
./kodi.nix
./htpc.nix
];
profiles.htpc.enable = true;
}
@ljavuras
ljavuras / List of icons.md
Last active May 1, 2025 00:19
List of icons in Obsidian
/**
 * List all icons available to `obsidian.setIcon()`
 * 
 * @author Ljavuras <ljavuras.py@gmail.com>
 */

dv.container.createEl("style", { attr: { scope: "" }, text: `
.icon-table {
 display: flex;
@MuhsinFatih
MuhsinFatih / fix-macos-python.md
Last active May 1, 2025 00:17
How to recover from messed up python installation on mac, and never have to mess with apple's shitty python confusion factory

I am assuming you are here because like me, you installed a bazillion different python interpreters on mac and the whole thing is a spagetti. Today, I finally fixed my python installation. Whatever I install for python2 or python3 using pip JUST.WORKS.. My god! finally.

What the hell?

Here is what I had messed up, which you also probably did:

  • I had too many different python interpreters
  • Too many different symlinks which I lost track of
  • almost no package I installed with pip worked without a headache
  • any attempt to fix using online resources made it worse.