Skip to content

Instantly share code, notes, and snippets.

View uriel1998's full-sized avatar

Steven Saus uriel1998

View GitHub Profile
#!/bin/bash
# uses a complex sed string -- along with copyq and xclip -- to pull a selected string in and capitalize it.
# I use this with AutoKey.
# see https://ideatrash.net/2024/06/using-sed-to-capitalize-titles-and-a-tricky-escaping-problem.html for explanation
/usr/bin/copyq select 0
/usr/bin/copyq read 0 | sed -e "s/\b\(.\)/\u\1/g" -e "s/-\(.\)/-\u\1/g" -e 's/“/"/g' -e 's/”/"/g' -e "s/’/'/g" -e 's/—/ -- /g' -e 's/ — / -- /g' -e 's/ - / -- /g' -e 's/ – / -- /g' -e 's/ – / -- /g' -e "s/"\'"\([A-Z]\)\b/"\'"\l\1/g" -e "s/"\'"\([A-Za-z][A-Za-z]\)\b/"\'"\l\1/g" | /usr/bin/copyq write 0 -
/usr/bin/copyq select 0
/usr/bin/copyq read 0 | xclip -i
@uriel1998
uriel1998 / gist:3a5a85af5b356d0b39b74be582da27d1
Last active April 3, 2024 01:08
AI generated summaries of four of my blog posts
Summary of : https://ideatrash.net/2024/03/a-review-of-men-2022-for-men.html
The passage is a review of the 2022 film "Men" and its exploration of the pervasive nature of sexism and misogyny perpetuated by men. The author reflects on their own struggles with inappropriate humor and the discomfort it has caused female-presenting people in their life. The film's blunt depiction of how all men, even well-intentioned ones, can contribute to an oppressive environment for women is deeply unsettling for the author. The passage challenges other men to watch the film and confront their own harmful behaviors, rather than just pointing fingers at the most egregious offenders. Ultimately, the author emphasizes the importance of men holding themselves and each other accountable for the damage caused by toxic masculinity.
Summary of : https://ideatrash.net/2024/04/blame-by-association-disclaimers-and-being-better.html
The passage discusses the issue of "blame by association" - the tendency to criticize or avoid engaging
@uriel1998
uriel1998 / gist:71a94220feb2b9f159ff4126839163c0
Created August 19, 2023 08:15
convert images between formats -- uses imagemagick and heif-convert
#!/bin/bash
# uses heif-convert: https://pypi.org/project/heif-convert/
# uses imagemagick: https://imagemagick.org/
if [ "${2}" == "" ];then
echo "We need an output format, thanks."
exit 99
fi
@uriel1998
uriel1998 / gist:402bebb02d071039032d77f286b2c40d
Last active August 19, 2023 08:11
fehview.sh -- uses feh, gifview, and heif-convert to get quick previews
#!/bin/bash
# uses gifview: https://linux.die.net/man/1/gifview
# uses heif-convert: https://pypi.org/project/heif-convert/
shopt -s nullglob
if [[ ! -f $1 ]]; then
notify-send "ERROR"
echo "$0: first argument is not a file" >&2
@uriel1998
uriel1998 / gist:da34848e2cbd3d3d1169d9a2a77d4127
Created August 19, 2023 08:03
Small script to fix symlink for beeper if you installed the AppImage via bauh instead of AppImageLauncher
#!/bin/bash
if [ ! -e "${HOME}/.local/bin/beeper" ] ; then
new_version=$(/usr/bin/ls ${HOME}/.local/share/bauh/appimage/installed/beeper/*.AppImage)
if [ -f "${new_version}" ];then
rm "${HOME}/.local/bin/beeper"
ln -s "${new_version}" "${HOME}/.local/bin/beeper"
else
echo "Beeper AppImage not found in bauh install directory!" >&2
exit 99
@uriel1998
uriel1998 / gist:98aa75ce04d92704549bce1aaa16883e
Created May 3, 2022 19:54
xml for bitlbee twitter follow chat room
<channel name="#t_news" type="chat">
<setting name="account">twitter</setting>
<setting name="auto_join">true</setting>
<setting name="chat_type">room</setting>
<setting name="room">follow:daytondailynews;follow:whiotv;follow:pinknews;follow:abc;follow:cnn;follow:guardian;follow:whioradio;follow:nowthisnews;follow:ap;follow:wyso;follow:wdtn;follow:bbcbreaking;follow:npr;follow:wsj;follow:reuters;follow:washingtonpost;follow:nytimes;follow:bbcworld;follow:cnnbrk</setting>
</channel>
@uriel1998
uriel1998 / gist:5531694b41dc54a004e05c3feeb09450
Last active December 15, 2021 15:48
example of processed barometric data
1639562402,2021-12-15,04:51,30.26,in,1025,hPa,0,0,0,0,0,0,0,0,0,0,-1,-1,-2,-1,-2,0,-2,-2,-2,-3,-3,-3,-3,-3,-3,-3,-4,-4,-3,-3,-3,-3,-4,-3,-4,-4,-4,-5,-6,-6,-5,-5,-6,-6,-6,-6,-6,-7,-6,-6
1639564201,2021-12-15,05:21,30.23,in,1024,hPa,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-2,-2,-3,-2,-3,-1,-3,-3,-3,-4,-4,-4,-4,-4,-4,-4,-5,-5,-4,-4,-4,-4,-5,-4,-5,-5,-5,-6,-7,-7,-6,-6,-7,-7,-7,-7,-7,-8,-7
1639566001,2021-12-15,05:51,30.26,in,1025,hPa,1,0,0,0,0,0,0,0,0,0,0,0,-1,-1,-2,-1,-2,0,-2,-2,-2,-3,-3,-3,-3,-3,-3,-3,-4,-4,-3,-3,-3,-3,-4,-3,-4,-4,-4,-5,-6,-6,-5,-5,-6,-6,-6,-6,-6,-7
1639567801,2021-12-15,06:21,30.26,in,1025,hPa,0,1,0,0,0,0,0,0,0,0,0,0,0,-1,-1,-2,-1,-2,0,-2,-2,-2,-3,-3,-3,-3,-3,-3,-3,-4,-4,-3,-3,-3,-3,-4,-3,-4,-4,-4,-5,-6,-6,-5,-5,-6,-6,-6,-6,-6
1639569602,2021-12-15,06:51,30.23,in,1024,hPa,-1,-1,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-2,-2,-3,-2,-3,-1,-3,-3,-3,-4,-4,-4,-4,-4,-4,-4,-5,-5,-4,-4,-4,-4,-5,-4,-5,-5,-5,-6,-7,-7,-6,-6,-7,-7,-7,-7
1639571402,2021-12-15,07:21,30.23,in,1024,hPa,0,-1,-1,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,
@uriel1998
uriel1998 / gist:1636d28af562bb85297041a6b9d450aa
Last active October 20, 2021 13:23
Comparison of a simple document in multiple formats
########### MARKDOWN ###########
Easily readable; you can hand this to someone who has never seen markdown
before and they won't have a problem. (You can use underscores instead of
asterisks, but I've found asterisks make more intuitive sense
to people who aren't familiar with the format.) Filesize 157 bytes.
# This is a level one header
## This is a level two header
### This is a level three header
@uriel1998
uriel1998 / eOSUDS.sh
Last active October 12, 2021 23:47 — forked from ImranR98/eOSUDS.sh
elementaryOS 6 has great dark themes, but they only apply to "curated" appcenter apps. This script forces the system theme to work with regular Debian packages as well as non-curated Flatpak apps. It also optionally changes the wallpaper based on the theme. It also supports changing themes for the Mailspring email app (both .deb and Snap versions).
#!/usr/bin/bash
# =======================================
# eOS-Universal-Dark-Style
# =======================================
# elementaryOS 6 has great dark themes, but they only apply to "curated" appcenter apps
# This script forces the system theme to work with regular Debian packages as well as non-curated Flatpak apps
# It also optionally changes the wallpaper based on the theme
@uriel1998
uriel1998 / gist:14f8b7e931ba4dbf65e62618d276c6c5
Created August 30, 2021 18:46
top level tld for filtering in a pastebin type of application
.ac, .act, .ad, .ae, .aero, .af, .ag, .ai, .al, .am, .an, .ao, .ar, .arpa, .as, .at, .au, .aw, .ax, .az, .bb, .bd, .be, .bf, .bm, .bn, .bo, .br, .bs, .bt, .bw, .by, .ca, .cc, .cd, .ch, .ck, .cn, .co, .com, .cr, .cu, .cx, .cy, .dm, .do, .domains, .dz, .ec, .ee, .eg, .es, .et, .fi, .fj, .fk, .fr, .ge, .gg, .gh, .gi, .gn, .gp, .gr, .hk, .hn, .hr, .ht, .hu, .id, .ie, .il, .im, .in, .ip6.arpa, .ir, .it, .je, .jm, .jo, .jp, .kh, .kr, .kw, .ky, .kz, .lb, .lc, .level, .li, .lk, .lr, .ls, .lt, .lu, .lv, .ly, .ma, .mc, .mg, .mil, .mk, .mo, .mobi, .mt, .mu, .mv, .mw, .mx, .my, .ng, .ni, .nl, .no, .np, .nr, .nsw, .nt, .nz, .om, .or, .pa, .pe, .pf, .pg, .ph, .pk, .pl, .plp, .pr, .pro, .ps, .pt, .py, .qld, .ro, .ru, .rw, .sa, .sb, .sc, .sd, .se, .sg, .sv, .sy, .tas, .th, .tj, .tn, .to, .tp, .tr, .tt, .tv, .tw, .tz, .ua, .ug, .uk, .us, .uses, .uy, .va, .ve, .vi, .vic, .vn, .wa, .ye, .yu, .za, .zm, .zw