Skip to content

Instantly share code, notes, and snippets.

View akirak's full-sized avatar

Akira Komamura akirak

  • Japan Standard Time
  • 02:11 (UTC +09:00)
View GitHub Profile
@rougier
rougier / dual-header.el
Created December 30, 2024 19:08
Emacs dual header line
;; Dual header line is possible by exploiting the tab-bar line that
;; sits on top of the header line and is generally hidden. For the
;; icon, it has to be precisely cut in top and bottom part and each
;; part is concatenated with either the tab-line or header-line.
(defun dual-header (top bottom)
"This installs a double line header in current buffer using both tab line (TOP) and header line (BOTTOM)."
(set-face-attribute 'tab-line (selected-frame)
@asa1984
asa1984 / Darwinが来た!.md
Last active December 9, 2024 10:15
Darwinが来た! / asa1984 Advent Calendar 2024 6日目

Darwinが来た!

ここは「asa1984 Advent Calendar 2024」6日目の記事。Windowsの群れ、Linuxの群生地、悠然と空を舞うAndroid…パーツとソフトウェアが生い茂る大草原には、様々なコンピューターが暮らしています。

そんな中、他のコンピューターたちから遠く離れた場所にポツリと1枚の銀の板が。見つけましたM1 Macbook Airです!

今回は幻のOS・macOSの不思議な生態に迫ります。

セットアップ

@lazy
lazy / init.el
Last active December 15, 2023 05:14
(use-package vertico-posframe
:config
(setq vertico-posframe-parameters
'((left-fringe . 8)
(right-fringe . 8)))
(setq vertico-posframe-border-width 3)
:init
(vertico-posframe-mode)
@rickhull
rickhull / configuration.nix
Last active March 29, 2025 07:38
Prometheus, Grafana, Loki, Promtail on NixOS
# MONITORING: services run on loopback interface
# nginx reverse proxy exposes services to network
# - grafana:3010
# - prometheus:3020
# - loki:3030
# - promtail:3031
# prometheus: port 3020 (8020)
#
services.prometheus = {
@folliehiyuki
folliehiyuki / init.lua
Last active January 22, 2024 06:43
River wayland compositor configuration in lua5.4
#!/usr/bin/lua5.4
--[[
NOTE:
- execp() needs 'lua-posix' package
- bitwise operands for tag mappings need Lua version >= 5.3
--]]
@udf
udf / write_up.md
Last active April 15, 2025 07:57
A Trick To Use mkMerge at The Top Level of a NixOS module

The Setup

I wanted to write a module that generates multiple systemd services and timers to scrub some zfs pools at certain intervals. The default scrub config does not support individual scrub intervals for each pool.

I want the config to look like this:

{
  services.zfs-auto-scrub = {
 tank = "Sat *-*-* 00:00:00";
@ryansolid
ryansolid / framework size comparison.md
Last active October 22, 2022 13:27
Size Comparison Vue vs Svelte vs Solid

Based on Evan You's methodology: https://github.com/yyx990803/vue-svelte-size-analysis

Table

Vue Vue (SSR) Svelte Svelte (SSR) Solid Solid (SSR)
Source 3.93kb - 3.31kb - 4.98kb -
Compiled w/o imports (min) 2.73kb - 5.01kb (183.52%) 6.59kb (241.39%) 3.68kb (134.805) 3.96kb (145.05%)
Compiled w/o imports (min+gz) 1.25kb - 2.13kb (170.40%) 2.68kb (214.40%) 1.46kb (116.80%) 1.57kb (125.60%)
Compiled w/o imports (min+brotli) 1.10kb - 1.88kb (170.91%) 2.33kb (211.82%) 1.26kb (114.55%) 1.32kb (120.00%)
@bitonic
bitonic / configuration.nix
Last active April 24, 2025 10:07
NixOS configuration for a remote ZFS server on Hetzner
# Full NixOS configuration for a ZFS server with full disk encryption hosted on Hetzner.
# See <https://mazzo.li/posts/hetzner-zfs.html> for more information.
{ config, pkgs, ... }:
let
# Deployment-specific parameters -- you need to fill these in where the ... are
hostName = "...";
publicKey = "...";
# From `ls -lh /dev/disk/by-id`
@Bondrake
Bondrake / trim-generations.sh
Last active February 29, 2024 01:10
NixOS script to keep 10 generations or 7 days, whichever is more (configurable, profile is selectable)
#!/usr/bin/env bash
set -euo pipefail
## Defaults
keepGensDef=10; keepDaysDef=7
keepGens=$keepGensDef; keepDays=$keepDaysDef
## Usage
usage () {
printf "Usage:\n\t trim-generations.sh (defaults are: Keep-Gens=$keepGensDef Keep-Days=$keepDaysDef Profile=user)\n\n"
@graninas
graninas / What_killed_Haskell_could_kill_Rust.md
Last active April 24, 2025 16:22
What killed Haskell, could kill Rust, too

At the beginning of 2030, I found this essay in my archives. From what I know today, I think it was very insightful at the moment of writing. And I feel it should be published because it can teach us, Rust developers, how to prevent that sad story from happening again.


What killed Haskell, could kill Rust, too

What killed Haskell, could kill Rust, too. Why would I even mention Haskell in this context? Well, Haskell and Rust are deeply related. Not because Rust is Haskell without HKTs. (Some of you know what that means, and the rest of you will wonder for a very long time). Much of the style of Rust is similar in many ways to the style of Haskell. In some sense Rust is a reincarnation of Haskell, with a little bit of C-ish like syntax, a very small amount.

Is Haskell dead?