This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (defun pro/package-upgrade-async (&optional _prefix) | |
| "Обновить все пакеты в полностью отдельном Emacs-процессе (-Q --batch). | |
| Лог в буфере *Package Upgrade Log*. Без вопросов (y/n), только прогресс и ошибки. | |
| Лог выводится поточно (line-buffered) при помощи stdbuf, при его отсутствии — через PTY. | |
| Дополнительно: устойчивость к ошибкам refresh, GC-тюнинг, тайминг выполнения, код выхода." | |
| (interactive "P") | |
| (let* ((buf (get-buffer-create "*Package Upgrade Log*")) | |
| (start-time (float-time)) | |
| ;; На случай, если текущий Emacs запущен через emacsclient — выбираем «настоящий» emacs. | |
| (emacs (or (and (not (string-match-p "emacsclient\\'" invocation-name)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| * Почему NixOS проще чем MacOS/Debian/Archlinux... | |
| Ты ставишь цель: “хочу, чтобы на моём ноуте/сервере были Docker, Nginx, PostgreSQL, открыты нужные порты, создан пользователь с ключом, и всё это работало одинаково каждый раз”. | |
| В Debian/Arch/macOS ты делаешь это руками: ставишь пакеты, правишь конфиги, включаешь сервисы, добавляешь себя в группы, настраиваешь файрвол. Через месяц забываешь, что именно делал, и на новой машине всё повторяется с нуля. | |
| В NixOS ты один раз описываешь желаемое состояние в файле. Потом выполняешь один rebuild. Всё. Система сама приводит себя к этому состоянию: установит пакеты, включит сервисы, создаст пользователя, откроет порты, разложит конфиги — без твоих ручных команд. Если что-то пошло не так — откат за один шаг. | |
| - Почему так проще | |
| - Декларативность: один файл — один источник правды о системе. | |
| - Воспроизводимость: пиннинг каналов через flakes, одинаковые версии везде. | |
| - Атомарные обновления и откаты: генерации системы переключаются без “полупочинки”. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Как сделать удобно в Emacs пользователю Винды | |
| - Включите CUA и привычное выделение: они дадут Ctrl+C/X/V, Shift+стрелки, замену выделенного при печати, правый клик — меню. | |
| - Добавьте небольшой глобальный minor-mode, который привяжет “виндовые” сочетания: Ctrl+Z, Ctrl+Shift+Z, Ctrl+S, Ctrl+Shift+S, Ctrl+O, Ctrl+Tab, Ctrl+F4, Alt+F4, Ctrl+колёсико масштаб и т.д. | |
| - Потенциально спорные переназначения (например, Ctrl+S на “Сохранить”, а не “Поиск”) можно включить опционально. | |
| - Быстрый старт | |
| #+begin_src emacs-lisp | |
| ;; 1) Базовая “Windows”-поведенка | |
| (cua-mode 1) ;; Ctrl+C/X/V, прямоугольники и т.п. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| * Асинхронность в Emacs Lisp на практике: от модели к надёжным паттернам | |
| ** Модель исполнения: почему в Emacs асинхронность выглядит так, а не иначе | |
| В основе Emacs — однопоточная модель исполнения с «глобальной блокировкой» интерпретатора Lisp. Это означает, что обычный Lisp‑код выполняется последовательно и не прерывается конкурентной работой другого Lisp‑кода. Асинхронные события (вывод процессов, сетевые данные, таймеры) обрабатываются в «точках ожидания»: когда Emacs ждёт ввода, перерисовки, данных от процессов, или когда вы явно вызываете функции ожидания. | |
| Такой дизайн приносит важные свойства. Он упрощает мышление: команда выполняется «атомарно», пользователь видит консистентное состояние буферов/окон, отладка предсказуемее. Он защищает редакторские структуры от гонок и убирает необходимость всюду ставить блокировки. Цена — отсутствие ускорения CPU‑задач «потоками Emacs Lisp» и необходимость явно уступать управление, чтобы асинхронные события исполнялись вовремя. Реальный параллелизм достигается че |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Available variables: | |
| // - Machine | |
| // - interpret | |
| // - assign | |
| // - send | |
| // - sendParent | |
| // - spawn | |
| // - raise | |
| // - actions |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Available variables: | |
| // - Machine | |
| // - interpret | |
| // - assign | |
| // - send | |
| // - sendParent | |
| // - spawn | |
| // - raise | |
| // - actions |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Available variables: | |
| // - Machine | |
| // - interpret | |
| // - assign | |
| // - send | |
| // - sendParent | |
| // - spawn | |
| // - raise | |
| // - actions |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ;;; nix-proced-readable-mode.el --- Make proced filenames more readable in NixOS and GuixSD | |
| ;; © 2019-∞ Peter 11111000000 <11111000000@email.com> | |
| ;; Autor: Peter 11111000000 <11111000000@email.com> | |
| ;; Maintainer: Peter 11111000000 <11111000000@email.com> | |
| ;; URL: https://gist.github.com/11111000000/e20247bafb425a58bd9d9198a16d56d0 | |
| ;; Keywords: guix nix proced | |
| ;; Package-Version: 0.1 | |
| ;; Version: 0.1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Муравьиный лев (antd-killer) | |
| */ | |
| import * as Layout from 'modules/layout'; | |
| import * as Menu from 'modules/menus'; | |
| export { Button } from 'modules/buttons' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module.exports = { | |
| use: [ | |
| 'neutrino-middleware-env', | |
| 'neutrino-preset-web', | |
| 'neutrino-preset-react', | |
| 'neutrino-preset-visualizer', | |
| 'neutrino-middleware-hot', | |
| ['neutrino-middleware-postcss', { | |
| plugins: [ | |
| require('postcss-partial-import')(), |
NewerOlder