Skip to content

Instantly share code, notes, and snippets.

View verhovsky's full-sized avatar

Boris Verkhovskiy verhovsky

View GitHub Profile
@verhovsky
verhovsky / minimal-stackoverflow-ui.txt
Last active October 8, 2022 11:04
Stack Overflow minimal content block
! This is a set of filters you can paste into uBlock Origin's "My filters" tab
! to reduce the clutter you see on Stack Overflow
stackoverflow.com,stackexchange.com,askubuntu.com,stackapps.com,mathoverflow.net,superuser.com,serverfault.com##.site-footer
stackoverflow.com,stackexchange.com,askubuntu.com,stackapps.com,mathoverflow.net,superuser.com,serverfault.com##.bottom-notice
stackoverflow.com,stackexchange.com,askubuntu.com,stackapps.com,mathoverflow.net,superuser.com,serverfault.com###hot-network-questions
stackoverflow.com,stackexchange.com,askubuntu.com,stackapps.com,mathoverflow.net,superuser.com,serverfault.com###feed-link
stackoverflow.com##.js-sidebar-zone
! causes suggested edit approve/reject dialog to be hidden on desktop
@verhovsky
verhovsky / funnyman
Last active January 18, 2024 17:36
Amusing `man` commands I've typed
man cat
man time
man date
man cut
man bash
man tree
man unzip
man route
man convert
man echo
@verhovsky
verhovsky / find_imports.py
Last active February 7, 2021 13:04
Which modules are imported in the Python standard library most often?
#!/usr/bin/env python3
# This script scans all .py files in cpython/Lib, finds all import statements
# in them and counts out what is imported most often in each top directory
# or file in Lib/ (meaning if some library is imported many times in various
# files in e.g. Lib/http/ , it will only be counted once).
#
# Clone the CPython repo then put this file in the top level cpython/
# directory and run it:
#
@verhovsky
verhovsky / symbol_names.md
Last active October 14, 2022 23:14
Urbit ASCII character names

Hoon is Urbit's high-level programming language. It compiles to Nock, Urbit's low-level language.

https://urbit.org/docs/glossary/

Hoon code makes heavy use of non-alphanumeric symbols. Reading off code aloud using the proper names of ASCII symbols is tedious, so we've mapped syllables to symbols:

ace [1 space]       gap [>1 space, nl]  pat @
@verhovsky
verhovsky / delete_duplicate_images.py
Last active October 22, 2018 11:17
a script that uses perceptual hashing (pHash) to find all the duplicated images in a directory and delete them
#!/usr/bin/env python3
'''
find all the duplicated images in the current directory using perceptual hashing and delete them
to install dependencies
$ pip install imagehash Pillow
usage: ./delete_duplicate_images.py [directory containing the images]
'''
@verhovsky
verhovsky / explanation.md
Last active February 8, 2024 20:17
Useful short prefix search engines for Chrome. Like adding DuckDuckGo bangs to google.

How to add DuckDuckGo bangs to Google (if you're using Chrome)

Chrome has a feature for defining your own search engines for the omni bar. It's intended for adding search boxes present on other websites, but it accepts arbitrary urls, including modified google search URLs. The URL for a google search query is just google.com/search?q=your+query+with+spaces+replaced+with+plus+signs, which means if you bind a "search engine" like google.com/search?q=wikipedia+%s to "w" you will automatically have the word "wikipedia" added to your search query if you search "w something". You won't even have to type the "!". Here's an example

Go to SettingsManage Search EnginesOther search enginesADD and then

Search engine: wikipedia

Keyword: w

@verhovsky
verhovsky / create_usb_from_iso.sh
Last active July 3, 2017 06:41
create bootable usb from .iso file on macOS
# if you want to boot a laptop from a USB drive and you have a file like archlinux-2017.07.01-x86_64.iso
# (and a USB drive plugged in), this is a script to copy the .iso onto the USB drive.
# like UNetbootin but debuggable.
# https://apple.stackexchange.com/questions/179781/how-to-create-a-bootable-ubuntu-usb-stick-using-os-x-10-10-2
ls
echo "path to .iso?"
read iso_filepath