Skip to content

Instantly share code, notes, and snippets.

@agriffis
agriffis / 99-monaspace-monospace.conf
Created November 15, 2023 17:56
Allow kitty to use Monaspace fonts
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<!-- https://sw.kovidgoyal.net/kitty/faq/#kitty-is-not-able-to-use-my-favorite-font -->
<fontconfig>
<match target="scan">
<test name="family"><string>Monaspace Argon Var</string></test>
<edit name="spacing"><int>100</int></edit>
</match>
<match target="scan">
<test name="family"><string>Monaspace Krypton Var</string></test>
@agriffis
agriffis / .bashrc
Last active September 17, 2023 20:09
TERM in bash and nushell
setup-TERM() {
# vte-256color messes up emacs with solarized, so use xterm-256color
# instead.
declare vte=xterm-256color
declare -a terms
case $TERM:$COLORTERM in
ansi:*)
# probably Windows telnet
TERM=vt100 ;;
@agriffis
agriffis / system.js
Created April 26, 2021 13:46
Custom xstyled re-exports
import * as R from 'ramda'
import scStyled from 'styled-components'
import * as xstyled from '@xstyled/styled-components'
import {
css,
defaultTheme,
Preflight,
style,
ThemeProvider,
useTheme,
@agriffis
agriffis / proxy.pac
Created February 2, 2021 13:08
proxy.pac for debugging
function FindProxyForURL(url, host) {
return "DIRECT";
}
@agriffis
agriffis / useForceRender.js
Last active June 27, 2020 21:55
usePromises React hook
import React from 'react'
/**
* React hook to force a re-render, for hooks with fancy state management.
*/
export const useForceRender = () => {
const [, emit] = React.useState()
// Stable function response, like useCallback without checking.
return React.useRef(() => {
@agriffis
agriffis / 0_sched.py
Last active April 22, 2019 17:22
RIPUL 2019 scheduling
#!/usr/bin/env python3
from collections import defaultdict, namedtuple
import functools
from pprint import pformat, pprint
import sys
Y = 2019
N = 16
@agriffis
agriffis / .vimrc
Created February 25, 2019 12:53
neovim clipboard provider for tmux and OSC 52
function! ClipboardCopy(lines, regtype)
let sum = TryClipboardCmd('md5sum', a:lines)
call writefile(sum, s:regtype_sum, 'S')
call writefile([a:regtype], s:regtype_txt, 'S')
return TryClipboardCmd('clipboard-provider copy', a:lines)
endfunction
function! ClipboardPaste()
let lines = TryClipboardCmd('clipboard-provider paste')
let regtype = 'V'
@agriffis
agriffis / smartctl.txt
Created May 5, 2018 18:46
smartctl fails
smartctl 6.6 2017-11-05 r4594 [x86_64-linux-4.16.5-300.fc28.x86_64] (local build)
Copyright (C) 2002-17, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF INFORMATION SECTION ===
Model Number: INTEL SSDPEKKW512G8
Serial Number: BTHH807007N4512D
-- Logs begin at Sat 2018-05-05 08:59:40 EDT, end at Sat 2018-05-05 09:38:54 EDT. --
May 05 09:36:22 localhost.localdomain kernel: Linux version 4.16.5-300.fc28.x86_64 (mockbuild@bkernel02.phx2.fedoraproject.org) (gcc version 8.0.1 20180324 (Red Hat 8.0.1-0.20) (GCC)) #1 SMP Fri Apr 27 17:38:36 UTC 2018
May 05 09:36:22 localhost.localdomain kernel: Command line: BOOT_IMAGE=/vmlinuz-4.16.5-300.fc28.x86_64 root=/dev/mapper/fedora_windows--obdemh7-root ro resume=/dev/mapper/fedora_windows--obdemh7-swap rd.lvm.lv=fedora_windows-obdemh7/root rd.lvm.lv=fedora_windows-obdemh7/swap rhgb quiet LANG=en_US.UTF-8
May 05 09:36:22 localhost.localdomain kernel: x86/fpu: Supporting XSAVE feature 0x001: 'x87 floating point registers'
May 05 09:36:22 localhost.localdomain kernel: x86/fpu: Supporting XSAVE feature 0x002: 'SSE registers'
May 05 09:36:22 localhost.localdomain kernel: x86/fpu: Supporting XSAVE feature 0x004: 'AVX registers'
May 05 09:36:22 localhost.localdomain kernel: x86/fpu: Supporting XSAVE feature 0x008: 'MPX

Out of the box, the new prompt depends on Nerd Fonts. Personally I'm using "DejaVuSansMono Nerd Font Complete." There are a couple ways around this if you'd rather: use fontconfig to merge Nerd symbols with your preferred font, see here and here; or you can override the various PS1_CHAR_* variables after loading .bashrc.prompt to use symbols already present in your font.