favicon.png vs favicon.ico – why should I use PNG instead of ICO?

Answer replaced (and turned Community Wiki) due to numerous updates and notes from various others in this thread: ICOs and PNGs both allow full alpha channel based transparency ICO allows for backwards compatibility to older browsers (e.g. IE6) PNG probably has broader tooling support for transparency, but you can find tools to create alpha-channel ICOs … Read more

Remove not alphanumeric characters from string

Removing non-alphanumeric chars The following is the/a correct regex to strip non-alphanumeric chars from an input string: Note that \W is the equivalent of [^0-9a-zA-Z_] – it includes the underscore character. To also remove underscores use e.g.: The input is malformed Since the test string contains various escaped chars, which are not alphanumeric, it will … Read more

Run script on mac prompt “Permission denied”

Please read the whole answer before attempting to run with sudo Try running sudo /dvtcolorconvert.rb ~/Themes/ObsidianCode.xccolortheme The sudo command executes the commands which follow it with ‘superuser’ or ‘root’ privileges. This should allow you to execute almost anything from the command line. That said, DON’T DO THIS! If you are running a script on your … Read more

Disable / Enable Button in TKinter

A Tkinter Button has three states : active, normal, disabled. You set the state option to disabled to gray out the button and make it unresponsive. It has the value active when the mouse is over it and the default is normal. Using this you can check for the state of the button and take … Read more

What does set -e mean in a bash script?

From help set : But it’s considered bad practice by some (bash FAQ and irc freenode #bash FAQ authors). It’s recommended to use: to run do_something function when errors occur. See http://mywiki.wooledge.org/BashFAQ/105