Skip to content

Instantly share code, notes, and snippets.

Rusty's API Design Manifesto

The idea

Application Programming Interface (API) design is hard. But it's even harder to change once you get it wrong. So what you should do is to spend the effort to get it right the first time around.

In the Linux Kernel community Rusty Russell came up with a API rating scheme to help us determine if our API is sensible, or not. It's a rating from -10 to 10, where 10 is perfect is -10 is hell. Unfortunately there are too many examples at the wrong end of the scale.

Rusty's original descriptions

@codigoconjuan
codigoconjuan / db.js
Created August 22, 2023 23:18
Gist Guitarras para GuitarLA - React y TypeScipt - La Guía Completa
export const db = [
{
id: 1,
name: 'Lukather',
image: 'guitarra_01',
description: 'Morbi ornare augue nisl, vel elementum dui mollis vel. Curabitur non ex id eros fermentum hendrerit.',
price: 299,
},
{
id: 2,
@aamiaa
aamiaa / CompleteDiscordQuest.md
Last active May 12, 2024 14:54
Complete Recent Discord Quest

Complete Recent Discord Quest

Note

This no longer works in browser!

Note

This no longer works if you're alone in vc! Somebody else has to join you!

How to use this script:

  1. Accept the quest under User Settings -> Gift Inventory
@nathan818fr
nathan818fr / x570_aorus_master.conf
Last active May 12, 2024 14:46
lm-sensors config for X570 AORUS MASTER
# /etc/sensors.d/x570_aorus_master.conf
# Gigabyte X570 AORUS MASTER
#
# dmi: Board Manufacturer: Gigabyte Technology Co., Ltd.
# dmi: Board Product Name: X570 AORUS MASTER
#
# Require https://github.com/frankcrawford/it87
chip "acpitz-acpi-0"
# temp1 and temp2 are hardcoded and always returns 16.8°C
##
## Arch Linux repository mirrorlist
## Generated on 2023-10-27
##
## Bangladesh
Server = http://mirror.xeonbd.com/archlinux/$repo/os/$arch
## India
Server = http://mirror.4v1.in/archlinux/$repo/os/$arch
@loderunner
loderunner / 01-mac-profiling.md
Last active May 12, 2024 14:43
Profiling an application in Mac OS X

Profiling an application in Mac OS X

Finding which process to profile

If your system is running slowly, perhaps a process is using too much CPU time and won't let other processes run smoothly. To find out which processes are taking up a lot of CPU time, you can use Apple's Activity Monitor.

The CPU pane shows how processes are affecting CPU (processor) activity:

@REDVM
REDVM / immich_auto_album.py
Last active May 12, 2024 14:43
Create and populate albums on Immich based on folder name
import requests
import os
from collections import defaultdict
# I have photos in subfolders like :
# /mnt/media/Photos/2023-08 Holidays
# /mnt/media/Photos/2023-06 Birthday
# /mnt/media/Photos/2022-12 Christmas
# This script will create 3 albums
# 2023-08 Holidays, 2023-06 Birthday, 2022-12 Christmas
@wojteklu
wojteklu / clean_code.md
Last active May 12, 2024 14:39
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules