Categories
Dev

PHP floating point precision

I was attempting to find if the result of a calculation returned a number with any decimals. So, I was doing something like: To my surprise the code above returns: ‘has decimals’ If you do the math in any calculator the result of 123.1/0.1=1231 and in fact that is what PHP displays when you do: […]

Categories
Dev Mac

Change macOS terminal shell to Bash 5

Since macOS Catalina that zsh is the default shell. From what I could understand this was caused by a change in Bash license to GPL after version 3. So, since version 3 of Bash is pretty old they changed the default to zsh. Since Homebrew is not yet fully Apple Silicon compatible using Homebrew was […]

Categories
Dev Mac Tech

MAMP Pro – Oops, something is badly wrong!

Out of the blue, MAMP Pro started presenting me with an alert when I tried opening the app: Oops, something is badly wrong!Either you did not provide the necessary admin credentials or the MAMP PRO package could not be initialized correctly. You can either restart the application and try again or re-install the software. I […]

Categories
Dev

Change dropdown align to right underscores.me

The dropdown sub menus for underscores.me by default align left. If you need to change it to align right, go into style.css “# Menus” and change the following lines: .main-navigation ul li:hover > ul, .main-navigation ul li.focus > ul { left: auto; right: 0%; } .main-navigation ul ul li:hover > ul, .main-navigation ul ul li.focus […]

Categories
Dev Tech

Adding Placeholder attribute to Tokeninput jQuery plugin

I was having a hard time to get the placeholder attribute to work with Tokeninput jQuery plugin. First I managed to get it to show up by adding attr(‘placeholder’) to the onReady: $(“#myInput”).tokenInput(“/url/to/your/script/”){ onReady: function(){ $(‘#token-input-myInput’).attr(‘placeholder’,’type here…’); } }; It worked but every time it lost focus the resize of the input field would partially […]