Category Archives: MacOS

How to Reset MAC OS X DOCK to DEFAULT SETTINGS

First launch the Terminal app, located in the Utilities folder under Applications, or just hit Cmd + Space and type “Terminal“.

Type (copy & paste) the command below:

defaults delete com.apple.dock; killall Dock

Then hit return.

Your Dock will now be new as the day it shipped. You are free to mess it up again 🙂

Make a directory writable by Apache on Mac OS X

Just a quick reference on how to make a directory writable by OSX integrated Apache web server.

1. Set the ownership of your desired directory/file to the _www user:

sudo chown -R _www:staff path/to/folder/

2. Set the permissions so that the _www can write in the directory/file without giving permissions to everyone else:

sudo chmod -R 755 path/to/folder

Happy coding 🙂

Copying Cyrillic URLs in Google Chrome and Firefox

Using Google Chrome, I encountered strange bug affecting the copying and pasting of cyrillic urls.

When pasting, the non ASCII characters in the Url are converted to Punycode.

Performing some tests revealed that the same behaviour is present also in Firefox.

Punycode produced by Google Chrome and Firefox

Punycode produced by Google Chrome and Firefox

Doing some research led me to Issue 68718, unfortunately marked as WontFix stating:

Links on Wikipedia itself are a red herring, as comment 50 notes -- they're escaped in the page source.  The actual issue here is demonstrated by the link in comment 0.  We escape URLs when copying them.  This behavior matches Firefox 4 (by default) and Safari 5, though not IE9.

We added this behavior on  issue 2820  to fix a variety of problems in languages like Japanese.  Because those problems resulted in users unable to navigate to the pasted links, whereas this issue seems to be solely about cosmetics (in that escaped URLs are ugly and hard to read), preserving that behavior change seems like the more important thing to do.

Workarounds

Few things can be done if this issue is affecting your day to day usage of Google Chrome…

  • Before copying the URL add any character at the end of it, then erase it. After this operation the copied URL will preserve its structure not producing punycode when pasted.
  • Use the COPY URL extension.
  • Use a different browser. Microsoft Edge on Windows and Safari on OSX are producing the expected results.

Featured Image: https://wallpapercave.com/w/A7ZAUTz