Skip to content

Instantly share code, notes, and snippets.

View b0o's full-sized avatar
👻

Maddison Hellstrom b0o

👻
View GitHub Profile
@b0o
b0o / smart-fzf.zsh
Last active February 14, 2021 04:25
# fzf path finding filesystem navigation thing by maddy (github.com/b0o)
#
# key bindings:
# - return: accept final
# - alt-return: accept final (absolute)
# - esc: escape
# - ctrl-g: escape (absolute)
# - alt-o: accept query
# - alt-P append query
# - ctrl-o: replace query
#!/usr/bin/env zsh
function _progress_bar() {
{
local -i width=$COLUMNS
local -i terminfo=1
local -i overwrite=1
local -i head_set=0
local msg=""
local progress="step"
@b0o
b0o / popup-detect.js
Last active March 21, 2024 01:12
Sway browser pop-up window float hack
// ==UserScript==
// @name Sway Popup Window Detector
// @namespace https://maddison.io/
// @version 0.1
// @description Detect "pop-up" windows because for some reason Wayland doesn't have a built-in way to do it??!
// @author Maddison Hellstrom <github.com/b0o>
// @include /^.*$/
// @grant none
// @run-at document-start
// ==/UserScript==
@b0o
b0o / vowel-words.sh
Created July 16, 2020 22:22
vowel-words
#!/bin/bash
awk 'tolower($0) ~ /^[b-df-hj-np-tv-z]*a[b-df-hj-np-tv-z]*e[b-df-hj-np-tv-z]*i[b-df-hj-np-tv-z]*o[b-df-hj-np-tv-z]*u[b-df-hj-np-tv-z]*$/{ print $0 }' words.txt
module {
name: "neuron-autoindex",
version: "0.1.0",
description: "generate hierarchical indices for neuron notes",
authors: ["Maddison Hellstrom <maddy@na.ai>"],
license: "GPL-3",
};
def invert_tags:
.
@b0o
b0o / aag
Last active April 16, 2022 00:54
aag: per-file logical AND of multiple ag searches
#!/bin/bash
#
# ag with logical AND of multiple searches
#
# Copyright (C) 2020 Maddison Hellstrom <https://github.com/b0o>
#
# 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 3 of the License, or
# (at your option) any later version.
#!/bin/bash
# iqalc = fzf + qalc ^ love
#
# (c) 2020 Maddison Hellstrom (github.com/b0o)
#
# 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 3 of the License, or
# (at your option) any later version.
#!/bin/bash
# Helper for yglu to assist with importing yaml files into the document
# root.
#
# Depends: yglu - https://github.com/lbovet/yglu/
#
# Copyright (c) 2020 Maddison Hellstrom (github.com/b0o)
#
# This program is free software: you can redistribute it and/or modify
server {
listen 8000;
# user to redirect to if none is passed in the URL
# set to the empty string ("") to disable
set $default_user maddy;
# Private user directories, e.g. localhost:8000/~user/private/secrets.txt
location ~ ^/~(.+?)/private(/.*)?$ {
auth_basic "Private directory for ~$1";
#!/bin/bash
n="${1:-1}"
output="$(
curl -s "https://www.archlinux.org/feeds/news/" \
| xmlstarlet sel -T -t -m /rss/channel/item -v "concat(pubDate,': ',title)" -n \
| head -n "$n"
)"
echo -e "\e[1;31mhttps://www.archlinux.org/"
echo "$output"
echo -en "\e[0m"