20 random bookmarks

Тут будут ссылки на всё-всё, что я найду интересным

2026-09-09

1016.

Heap's algorithm

en.wikipedia.org/wiki/Heap's_algorithm
// Output the k! permutations of A in which the first k elements are permuted in all ways.
// To get all permutations of A, use k := length of A.
//
// If k > length of A, will try to access A out of bounds.
// If k <= 0 there will be no output (empty array has no permutations)
procedure permutations(k : integer, A : array of any):
    if k = 1 then
        output(A)
    else
        // permutations with last element fixed
        permutations(k - 1, A)
        // permutations with last element swapped out
        for i := 0; i < k-1; i += 1 do
            if k is even then
                swap(A[i], A[k-1])
            else
                swap(A[0], A[k-1])
            end if
            permutations(k - 1, A)
        end for
    end if

2026-04-20

961.

7 Years and 21 Self-Improvement Experiments: Where They All Are Today

www.raptitude.com/2015/12/7-years-experiments

Experiment 5

Goal: Go 21 straight days without complaining or uttering non-constructive criticism. (If I catch myself doing it, I must start again at day zero.)

This was inspired by Will Bowen’s book A Complaint Free World, in which he claims that if you stop pronouncing your negative thoughts, you stop having those kinds of thoughts, and that if everyone did this the world would change completely.

What happened: It took 55 days to get 21 complaint-free days in a row, but I did it. This experiment really does teach you not to complain, and I think everyone should do it once in their lives. But it didn’t create much of an inner change. My negative thoughts were unaffected, I just got more polite about whether to pass them on to others. Complaining can even be a worthwhile form of bonding, as I learned while I was working a painful manual labor job with new friends, and could never join in on the lighthearted griping. Still, it’s better to never complain than to complain freely.

Where I am with it today: Even though the exercise didn’t eliminate internal negativity like the book promised, the experiment left me much more conscious about expressing needless negativity, and I am pretty good at keeping it to myself most of the time. I’m also more patient with others when they’re complaining. This is one experiment I would recommend to almost anybody.

2025-02-12

836.

Profiling Go programs with pprof

jvns.ca/blog/2017/09/24/profiling-go-with-pprof

2025-02-06

834.

Как мы искали ЗОЛОТО на Алтае

www.youtube.com/watch?v=mZiyGreug-U

2025-02-02

831.

Просто берите Postgres

grishaev.me/just-use-postgres

2024-09-11

761.

Every productivity thought I've ever had, as concisely as possible - Alexey Guzey

guzey.com/productivity

A - The task requirements and goals might not be clear enough. If you are trying to get yourself to “plan for a project” or “write a book” then it’s hard to identify the next actionable items. Put some time aside to figure out what physical things you can do to move the project forward. Try break down the larger tasks into the smallest pieces possible. The goal of the project might need identifying, or the requirements fleshed out from a supervisor.

B - The task might exceed your current competency. Sometimes we know what we have to do, but don’t know how to do it, and then we become avoidant rather than admitting this. In this case, it’s worth figuring out what you do know how to do and what you don’t know how to do, and be honest with that. Then slowly ask for help or read up on the things you don’t know.

C - The tasks might really not be worth it. Sometimes you are assigned tasks that don’t actually help you achieve your long-term goals, and so your brain demotivate you from doing them. Maybe the payoff is low, maybe you don’t learn anything new from them, or maybe a colleague you don’t like will gain credit for the tasks, or maybe you just wont be rewarded or appreciated for getting the tasks done.

2024-08-28

748.

Сколько стоит эффективность терапии

spectator.ru/entry/6709

2024-04-05

599.

Психополитика и нейрональное насилие

insolarance.com/psychopolitics

Психополитика – это совокупность властных инструментов управления неолиберальным «субъектом достижений», основанных на императиве «ты можешь», самодисциплине и самостимуляции для повышения эффективности в стремлении к новым свершениям, что мотивируется идеей о том, что каждый человек – предприниматель самого себя и жизнь каждого должна стать успешным экономическим проектом.

2024-03-27

590.

Подкасты с «продакшеном»

ilyabirman.ru/meanwhile/all/podsasts-production

Бесит, что всё больше подкастов монтируют и оформляют всякими джинглами, перебивками и эффектами. Такое ощущение, что туда понаприходили люди с радио и телевидения, которые не понимают, как устроен интернет, и притащили с собой весь эфирный мусор. Причём многие слушатели, кто открывают для себя подкасты только в последнее время, думают, что так и надо, и не видят в этом абсурда — другого-то они не слышали!

2024-03-06

547.

Dysfunctional options pattern in Go

rednafi.com/go/dysfunctional_options_pattern
package src

type config struct {
    // Required
    foo, bar string

    // Optional
    fizz, bazz int
}

// Each optional configuration attribute will have its own public method
func (c *config) WithFizz(fizz int) *config {
    c.fizz = fizz
    return c
}

func (c *config) WithBazz(bazz int) *config {
    c.bazz = bazz
    return c
}

// This only accepts the required options as params
func NewConfig(foo, bar string) *config {
    // First fill in the options with default values
    return &config{foo, bar, 10, 100}
}

func Do(c *config) {}

You’d use the API as follows:

package main

import ".../src"

func main() {
    // Initialize the struct with only the required options and then chain
    // the option methods to update the optional configuration attributes
    c := src.NewConfig("hello", "world").WithFizz(0).WithBazz(42)
    src.Do(c)
}

2024-03-01

539.

Exists is the enemy of good

seancoates.com/blogs/exists-is-the-enemy-of-good

This idea is pretty simple, in principle: sometimes we miss a good-enough solution because a not-quite-good-enough solution is already out there and in use.

2024-02-25

528.

Как посмотреть пароль от вайфая, который ваш компьютер уже знает

ilyabirman.ru/meanwhile/all/wifi-keychain

Бывает, вы с приятелем пришли в кафе, и он у вас спрашивает, какой тут пароль от вайфая. У вас подключен компьютер, потому что вы тут были год назад, но пароль вы не помните.

2024-01-27

502.

Вложенность

grishaev.me/nesting-01

Беру любой JSON и вижу, как его можно упростить, убрав лишнюю вложенность. Вдвойне обидно, что на эту вложенность кто-то тратил время, а она не нужна!

2023-12-12

454.

Finding unreachable functions with deadcode

go.dev/blog/deadcode

Functions that are part of your project’s source code but can never be
reached in any execution are called “dead code”, and they exert a drag
on codebase maintenance efforts.
Today we’re pleased to share a tool named deadcode to help you identify them.

2023-11-19

426.

Programming On 34 Keys

peppe.rs/posts/programming_on_34_keys

Minimizing your keyboard layout is a slippery slope.
34-keys has been reasonably comfortable to use, for both prose and program. My palms do not move across the desk at all, as I reach for keys. I mostly write Rust and Bash, and my layout has evolved to accomodate special characters from their grammars (angled brackets and hyphens, specifically). If you are on a similar journey, I would suggest focusing on accuracy and comfort over speed. Speed comes with time.

2023-11-04

395.

Visual Phenomena & Optical Illusions

michaelbach.de/ot

This huge collection of non-scary optical illusions and fascinating visual phenomena emphasizes interactive exploration, beauty, and scientific explanation.

2023-08-07

278.

Don't write bugs

www.teamten.com/lawrence/programming/dont-write-bugs.html

If you want a single piece of advice to reduce your bug count, it’s this:
Re-read your code frequently. After writing a few lines of code (3 to 6 lines, a short block within a function), re-read them. That habit will save you more time than any other simple change you can make.

2023-07-19

240.

MapRoulette

maproulette.org

Сайт с заданиями для создания, редактирования, проверки данных ОСМ

2023-06-18

208.

NYC Subwaysheds

subwaysheds.com

Интерактивная карта, которая показывает изохроны пути от выбранной станции Нью-Йоркского метрополитена, используя данные GTFS из Управления городского транспорта Нью-Йорка

2023-02-26

42.

Designing devices for long-term care and reuse

cheapskatesguide.org/articles/uncharitable.html