Skip to content

Instantly share code, notes, and snippets.

View b0o's full-sized avatar
👻

Maddison Hellstrom b0o

👻
View GitHub Profile
#!/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"
#!/bin/bash
set -euo pipefail
mlnew="/etc/pacman.d/mirrorlist.pacnew"
mldest="/etc/pacman.d/mirrorlist"
if [[ ! -f "$mlnew" ]]; then
echo "mirrorlist is up-to-date" >&2
exit
fi
#!/bin/bash
declare sway_lsof_f="/dev/null"
declare -i sleep_duration=1
declare -i sway_pid
sway_pid="$(pgrep -x sway)" || {
echo "sway process not found" >&2
return 1
}
[Unit]
Description=rclone sync (dropbox-maddy)
Documentation=http://rclone.org/docs/
After=network-online.target
[Service]
ExecStart=rclonesync-daemon -r dropbox-maddy:/Documents -s /home/maddy/Dropbox -w -t 30 -i 120 -u maddy sync
Restart=on-failure
RestartSec=5
#!/bin/bash
set -euo pipefail
initfile_name="rclonesync-init.txt"
watch=0
watch_interval=-1
watch_timeout=30
cmd=""
remote=""
function s:hlmgr(...)
let this = {}
let this.stack = []
func! this.push(rect)
let self.stack = [ a:rect ] + self.stack
endfunc
func! this.pop()
let [ l:rect; self.stack ] = self.stack
@b0o
b0o / key.md
Created February 28, 2019 10:03
Twitter (un)official Consumer Key

Twitter Official Consumer Key

Twitter for Android

type:            PIN
Consumer key:    3nVuSoBZnx6U4vzUxf5w
Consumer secret: Bcs59EFbbsdF6Sl9Ng71smgStWEGwXXKSjYvPVt7qys

Twitter for iPhone

type:            PIN

Consumer key: IQKbtAYlXLripLGPWd0HUA

function! ReggieStatus()
let l:pasteReg = g:GetPasteReg()
let l:yankReg = g:GetYankReg()
if l:pasteReg == l:yankReg
if l:pasteReg == '"'
return
endif
return 'yp="'.l:pasteReg
endif
return 'y="'.l:yankReg.',p="'.l:pasteReg
@b0o
b0o / reggie.vim
Last active December 9, 2018 02:54
function! s:regPrompt()
echo "SetReg: "
let l:rawchar = getchar()
let l:char = nr2char(l:rawchar)
call s:setReg(l:char)
endfunction
command! -bar -nargs=0 RegPrompt call <sid>regPrompt()
nnoremap <leader>" :RegPrompt<cr>
@b0o
b0o / xcqr
Created November 10, 2018 02:26
#!/bin/bash
qrencode -o - -s 1 \
"$(xclip -out -selection clipboard)" |
feh --zoom max \
--force-aliasing \
--image-bg white \
-