Skip to content

Instantly share code, notes, and snippets.

View aerosol's full-sized avatar
🌞
Praise the sun

hq1 aerosol

🌞
Praise the sun
View GitHub Profile
keymap("i", ",,", "<esc>\"tyiWi<<esc>Ea>", {})
keymap("i", ",.", "<esc>\"tyiWi<<esc>Ea><esc>i<space>", {})
keymap("i", "//", "</<esc>\"tpa>", {})
#!/usr/bin/env bash
# usage: split.sh <source_branch> <target_branch> [<main_branch>]
# example: split.sh origin/wip-feature-dirty feature-clean origin/main
# I often work on long-living dirty feature branches, saving garbage "wip"
# checkpoints, before I fully understand what am I even doing.
# When the feature is finished and tested, I end up with the garbage log that's
# mostly meaningless, but not quite. I find it hard to separate sensible commit
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<opml version="1.0">
<head>
<title>Pocket Casts Feeds</title>
</head>
<body>
<outline text="feeds">
<outline text="Stuff You Should Know" xmlUrl="https://www.omnycontent.com/d/playlist/e73c998e-6e60-432f-8610-ae210140c5b1/a91018a4-ea4f-4130-bf55-ae270180c327/44710ecc-10bb-48d1-93c7-ae270180c33e/podcast.rss" type="rss" />
<outline type="rss" xmlUrl="https://feeds.megaphone.fm/stufftoblowyourmind" text="Stuff To Blow Your Mind" />
<outline xmlUrl="https://feeds.megaphone.fm/stufftheydontwantyoutoknow" type="rss" text="Stuff They Don&apos;t Want You To Know" />
PID: 87969 (nvim)
UID: 1000 (hq1)
GID: 1000 (hq1)
Signal: 11 (SEGV)
Timestamp: Sun 2020-07-05 00:26:32 CEST (2min 47s ago)
Command Line: nvim
Executable: /usr/bin/nvim
Control Group: /user.slice/user-1000.slice/session-1.scope
Unit: session-1.scope
Slice: user-1000.slice
#!/usr/bin/env bash
url1="https://en.bab.la/dictionary/english-polish/$1"
url2="https://en.bab.la/dictionary/polish-english/$1"
shoot() {
curl -s $1 | pup 'div.content > div > div > div > ul.sense-group-results > li a text{}' 2>&1 |
awk 'NF' | head -n 3 | grep -v EOF
}
@aerosol
aerosol / gist:db32d2bf67f6aec36047eea5070f6b20
Last active August 21, 2019 09:39
Import andOTP data into iPhone authenticator with jq and imagemagick
jq -r '.[] | "qrencode -o- -d 300 -s 10 \"otpauth://totp/" + (.label | gsub("[- ]"; "%20")) + "?secret=" + .secret + "\" | display"' codes.txt | while read line; do
eval ${line}
done
#!/usr/bin/env bash
PROJECT=${1:-newproject}
git clone git@github.com:jgthms/bulma-start.git $PROJECT && cd $PROJECT && npm install
tmux split-window -h 'npx browser-sync start --server --files "*.html" --files "css/*.css"'
tmux split-window -v 'npm start'
nvim .
(gdb) thread apply all bt
Thread 36 (Thread 0x7f9473fff700 (LWP 8643)):
#0 0x00007f9526321c21 in poll () at /usr/lib/libc.so.6
#1 0x00007f94b85db673 in () at /usr/lib/libpulse.so.0
#2 0x00007f94b85cc990 in pa_mainloop_poll () at /usr/lib/libpulse.so.0
#3 0x00007f94b85ccfe0 in pa_mainloop_iterate () at /usr/lib/libpulse.so.0
#4 0x00007f94b85cd091 in pa_mainloop_run () at /usr/lib/libpulse.so.0
#5 0x00007f94b85db5ae in () at /usr/lib/libpulse.so.0
#6 0x00007f94b815e9fc in () at /usr/lib/pulseaudio/libpulsecommon-12.2.so
#!/usr/bin/bash
notify-send --icon=dialog-positive "$0" "$(timew start $1)" && echo "$1" > /tmp/track-current
#!/usr/bin/bash
notify-send --icon=dialog-error "$0" "$(timew stop $1)" && rm /tmp/track-current
#!/usr/bin/bash
if [ -f /tmp/track-current ]; then
arr[0]="*"
arr[1]="-"
@aerosol
aerosol / n.sh
Created September 7, 2018 06:21
#!/usr/bin/env zsh
function edit() {
mkdir -p "$(dirname "$1")" && $EDITOR "$1"
}
function pick() {
note=$(rg . | fzf --preview "cat \$(echo {} | tr ':' '\n' | head -n1)" | awk -F: '{print $1}')
if [[ -n $note ]]
then