Skip to content

Instantly share code, notes, and snippets.

View ngquerol's full-sized avatar
📖

Nicolas G. Querol ngquerol

📖
View GitHub Profile
@ngquerol
ngquerol / ns_system_appearance_change_emacs-30.patch
Last active October 24, 2024 19:06
Patch to make emacs (emacs-30 branch) aware of the macOS 10.14+ system appearance changes.
From ad923417a9a167ed07449ad0cb7b6c3e7759bb6d Mon Sep 17 00:00:00 2001
From: "Nicolas G. Querol" <[email protected]>
Date: Wed, 11 Nov 2020 12:35:47 +0100
Subject: [PATCH] Add `ns-system-appearance-change-functions' hook
This implements a new hook, effective only on macOS >= 10.14 (Mojave),
that is called when the system changes its appearance (e.g. from light
to dark). Users can then implement functions that take this change
into account, for instance to load a particular theme.
@ngquerol
ngquerol / cleanup_history.sh
Last active June 11, 2024 21:18
Cleanup fish history imported from zsh
#!/bin/sh
perl \
-0777 \
-pe \
-i.old \
"${HOME}/.local/share/fish/fish_history" \
's/- cmd: : (\d{10}):\d+;(.+)\n when: (\d{10})/- cmd: $2\n when: $1/g'
@ngquerol
ngquerol / sync_emacs_nsappeareance_patches.sh
Last active August 22, 2024 19:09
Script to automate maintainance of the ns_system_appearance emacs patch set
#!/bin/sh
set -eux
origin_remote="origin"
upstream_remote="upstream"
patch_branch_prefix="ns-system-appearance-change"
emacs_branches="master emacs-30 emacs-29 emacs-28 emacs-27"
gist_ids="9618d4aba60a6e691c3a4bdbefbdb9e9 ba7d50d281e71ba9a585be7c89590b1a 6dbb6f21bbb5756b59c1500f1f97094c 33e099eceae527b368bdf196c95d1ba3 8f430884386d1fcc4e216e484cc44c59"
@ngquerol
ngquerol / ns_system_appearance_change_emacs-29.patch
Last active June 26, 2024 20:45
Patch to make emacs (emacs-29 branch) aware of the macOS 10.14+ system appearance changes.
From d93d19eb895055a276f8c1f3dc889a9b2946ae37 Mon Sep 17 00:00:00 2001
From: "Nicolas G. Querol" <[email protected]>
Date: Wed, 11 Nov 2020 12:35:47 +0100
Subject: [PATCH] Add `ns-system-appearance-change-functions' hook
This implements a new hook, effective only on macOS >= 10.14 (Mojave),
that is called when the system changes its appearance (e.g. from light
to dark). Users can then implement functions that take this change
into account, for instance to load a particular theme.
@ngquerol
ngquerol / ns_system_appearance_change.patch
Last active October 24, 2024 19:06
Patch to make emacs (master branch) aware of the macOS 10.14+ system appearance changes.
From e089aaf3d8534c7a6201fdef53769383d98b14d8 Mon Sep 17 00:00:00 2001
From: "Nicolas G. Querol" <[email protected]>
Date: Wed, 11 Nov 2020 12:35:47 +0100
Subject: [PATCH] Add `ns-system-appearance-change-functions' hook
This implements a new hook, effective only on macOS >= 10.14 (Mojave),
that is called when the system changes its appearance (e.g. from light
to dark). Users can then implement functions that take this change
into account, for instance to load a particular theme.
@ngquerol
ngquerol / org-mode.css
Last active May 24, 2020 08:08
Self-contained stylesheet for org-mode HTML exports
html { margin: 0; padding: 0; box-sizing: border-box; }
*, *:before, *:after { box-sizing: inherit; }
body {
margin: 0 auto;
padding: 0;
max-width: 700px;
color: #555;
background-color: #fafafa;
@ngquerol
ngquerol / ns_system_appearance_change_emacs-28.patch
Last active April 3, 2024 17:10
Patch to make emacs (emacs-28 branch) aware of the macOS 10.14+ system appearance changes.
From 2fd6ee35bbcdd0a07e882e07706edaa01815853b Mon Sep 17 00:00:00 2001
From: "Nicolas G. Querol" <[email protected]>
Date: Wed, 11 Nov 2020 12:35:47 +0100
Subject: [PATCH] Add `ns-system-appearance-change-functions' hook
This implements a new hook, effective only on macOS >= 10.14 (Mojave),
that is called when the system changes its appearance (e.g. from light
to dark). Users can then implement functions that take this change
into account, for instance to load a particular theme.
@ngquerol
ngquerol / Makefile
Last active April 10, 2020 14:49
Generic Makefile for simple C projects, supporting compilation databases via Clang.
# Variables (all configuration should happen here)
SHELL = /bin/sh
CC = clang
CFLAGS = -Wall -Wextra -Wpedantic -std=c99
LDFLAGS =
RELEASE_CFLAGS = -Os
@ngquerol
ngquerol / typewriter.html
Last active April 1, 2020 18:34
Simple "typing" style animation.
<!doctype html>
<html>
<head>
<title>Typewriter</title>
<meta charset="utf-8" />
<style typeText="text/css" media="screen">
html, body {
height: 100%;
margin: 0;
}
@ngquerol
ngquerol / ns_system_appearance_change_emacs-27.patch
Last active April 3, 2024 17:11
Patch to make emacs (emacs-27 branch) aware of the macOS 10.14+ system appearance changes.
From 2d430cad16b7c7e62f36adf68f021b829aeff503 Mon Sep 17 00:00:00 2001
From: "Nicolas G. Querol" <[email protected]>
Date: Wed, 11 Nov 2020 11:38:05 +0100
Subject: [PATCH] Add `ns-system-appearance-change-functions' hook
This implements a new hook, effective only on macOS >= 10.14 (Mojave),
that is called when the system changes its appearance (e.g. from light
to dark). Users can then implement functions that take this change
into account, for instance to load a particular theme.