Skip to content

Instantly share code, notes, and snippets.

Avatar
🕴️

Andreas Fuchs antifuchs

🕴️
View GitHub Profile
@antifuchs
antifuchs / config.h
Created April 2, 2023 22:08
My ploopy configuration with some back/forward helpers & ad-hoc and permanent drag-scrolling support
View config.h
/* Copyright 2023 Andreas Fuchs <asf@boinkor.net>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
View boot-unlock.nix
# To set this up, first get tailscale working in an isolated linux shell:
# 1. sudo systemctl stop tailscaled.service
# 2. tailscaled -port 9993 -state tailscale-luks-setup.state -tun userspace-networking -socket ./tailscaled.sock
# 3. tailscale -socket ./tailscaled.sock up -hostname HOSTNAME-luks
# 4. tailscale -socket ./tailscaled.sock down
# 5. ctrl-c out of tailscaled
# 6 sudo systemctl start tailscaled.service
#
# Then add the .state file to your machine secrets and pass its path as tailscaleStatePath.
View homebrew.nix
{ lib, config, pkgs, ... }:
with lib;
let
cfg = config.homebrew;
caskAppdirStatement =
if (isNull cfg.cask_args.appdir)
then ""
else "cask_args appdir: '${cfg.cask_args.appdir}'";
View modes.py
from talon import Context, Module
mod = Module()
modes = {
"record": "enable recording mode, writes files to ~/.talon/recordings/",
}
for key, value in modes.items():
mod.mode(key, value)
@antifuchs
antifuchs / dock.nix
Last active August 15, 2022 19:30
A nix module that arranges the macOS dock the way you want it. Note: It won't allow you to manually re-arrange the items on it; the dock gets reset everytime you log in.
View dock.nix
{ config, pkgs, lib, ... }:
with lib;
let
cfg = config.local.dock;
stdenv = pkgs.stdenv;
in
{
options = {
local.dock.enable = mkOption {
description = "Enable dock";
View emacs-native-comp-linker-driver-options.patch
diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el
index c5027168be..81a5575d96 100644
--- a/lisp/emacs-lisp/comp.el
+++ b/lisp/emacs-lisp/comp.el
@@ -140,6 +140,16 @@ comp-async-env-modifier-form
:type 'list
:group 'comp)
+(defcustom comp-native-driver-options nil
+ "Options passed verbatim to the native compiler's backend driver.
@antifuchs
antifuchs / Cargo.toml
Created April 10, 2019 10:54
An example of a failing parse error kind implementation
View Cargo.toml
[package]
edition = '2018'
name = "wtf_nom"
version = "0.0.1-dev"
authors = ["Andreas Fuchs <asf@boinkor.net>"]
license = "MIT"
[dependencies]
nom = "4.2.3"
View nonzero_uint_literals.md
  • Feature Name: nonzero_uint_literals
  • Start Date: TODO
  • RFC PR:
  • Rust Issue:

Summary

Add an extension to the INTEGER_LITERAL syntax that allows users to specify literals as non-zero unsigned integers. We introduce a new

@antifuchs
antifuchs / asf-rustdoc-edit.el
Last active January 17, 2020 02:44
This sets up a key binding for C-c ' in rust-mode, which acts very similarly to org-src's key binding, except the other direction: If you use it on a rustdoc comment, it'll open another buffer with the comment in it, in markdown-mode.
View asf-rustdoc-edit.el
;;; Copyright (C) 2018, 2019 Andreas Fuchs <asf@boinkor.net>
;;; Made available to you under the terms of GPLv2 or later: https://choosealicense.com/licenses/gpl-2.0/
(use-package edit-indirect
:straight t)
(defconst asf--rustdoc-line-prefixes (concat "^\\([\t ]*" (regexp-opt '("///" "//!")) "\\)"))
(defun asf--rustdoc-current-comment-block-region ()
(save-excursion
View gist:a72a47ecaf9e395bd5383a9d7583e2d4
-*- mode: cargo-process; default-directory: "~/Hacks/fibonacci_codec/" -*-
Cargo-Process started at Sat Sep 15 20:08:25
/Users/asf/.cargo/bin/cargo test --manifest-path /Users/asf/Hacks/fibonacci_codec/Cargo.toml
Compiling fibonacci_codec v0.1.2-dev (file:///Users/asf/Hacks/fibonacci_codec)
warning: unused import: `fib_decode_u64`
--> tests/decode.rs:7:23
|
7 | use fibonacci_codec::{fib_decode_u64, fib_decode_u8, DecodeError, Encode};
| ^^^^^^^^^^^^^^