Josh Hagel

Category: Uncategorized (page 1 of 2)

Mac Run MAMPs Version of PHP

Sometimes it’s necessary/helpful to run MAMP’s version of PHP in the command line. A common issue I come across is systems that require the Mcrypt PHP extension (Yii2 and Laravel). It’s simple to setup a alias. Just copy and paste this code.

alias phpmamp='/Applications/MAMP/bin/php/php5.5.18/bin/php'

Note: Adjust your PHP version to match your desired version.

Then you can run PHP using phpmamp instead of php.

New Mac DNS Flush

Here are the updated ways to flush your DNS… This is helpful when changing domains around.

OSX 10.10

sudo lookupd -flushcache

OSX 10.10

sudo lookupd -flushcache

Mac – Fix End Key

The “END” key (fn+right arrow) doesn’t work right in mac. It goes to end of page instead of end of line.

Here is a quick little app that fixes that for you.

Great work on the app!

Separate Mac Dock Applications

Setting up my new Mac! One item that makes the dock more useful is spacing out the applications by group.

Add a spacer to your dock to make it easier to use.

Add a spacer to your dock to make it easier to use.

To add a spacer app;

1) Open Terminal Application

2) Type

defaults write persistent-apps -array-add '{tile-data={}; tile-type="spacer-tile";}'

3) Hit Enter

4) Type

killall Dock

5) Hit Enter

6) Move to separate applications

Website Rollout

How much have you planned and prepped for your website rollout?

Did you market it a ton, but didn’t actually build your infrastructure? Maybe you could work for the Government.

Mac VM Ware Keyboard Trick

VMWare Fusion Windows on Mac

I run VM Ware on my mac, this allows me to launch my Windows 7 partition without needing to reboot. This is great when dealing with the dreaded Internet Explorer.

However every time I set up the Virtual Machine I have issues where I loose my Keyboard for my mac, and it only works on my Virtual Machine.

There is a simple fix for this;

  1. Click on the Settings (Virtual Machine > Settings) for that virtual machine.
  2. Open USB & Bluetooth settings
  3. Make sure Share Bluetooth Devices with Windows is NOT checked.
  4. Close out settings and restart the virtual machine.

VMWare Fusion USB & Bluetooth Settings

CSS Hacks

As a developer I’m always searching the web for different CSS Hacks.

A CSS hack allows you to target a specific browser without effecting the others.

As much as I hope this helps you if your programming, it is also a not to self.

Most of these came from

Attribute Hacks

/* IE6 */
#once { _color: blue }

/* IE6, IE7 */
#doce { *color: blue; /* or #color: blue */ }

/* Everything but IE6 */
#diecisiete { color/**/: blue }

/* IE6, IE7, IE8, but also IE9 in some cases 🙁 */
#diecinueve { color: blue\9; }

/* IE7, IE8 */
#veinte { color/*\**/: blue\9; }

/* IE6, IE7 -- acts as an !important */
#veintesiete { color: blue !ie; } /* string after ! can be anything */

/* IE8, IE9 */
#anotherone  {color: blue\0/;} /* must go at the END of all rules */

/* IE9, IE10 */
@media screen and (min-width:0\0) {
    #veintidos { color: red}

Selector Hacks

/* IE6 and below */
* html #uno  { color: red }

/* IE7 */
*:first-child+html #dos { color: red }

/* IE7, FF, Saf, Opera  */
html>body #tres { color: red }

/* IE8, FF, Saf, Opera (Everything but IE 6,7) */
html>/**/body #cuatro { color: red }

/* Opera 9.27 and below, safari 2 */
html:first-child #cinco { color: red }

/* Safari 2-3 */
html[xmlns*=""] body:last-child #seis { color: red }

/* safari 3+, chrome 1+, opera9+, ff 3.5+ */
body:nth-of-type(1) #siete { color: red }

/* safari 3+, chrome 1+, opera9+, ff 3.5+ */
body:first-of-type #ocho {  color: red }

/* saf3+, chrome1+ */
@media screen and (-webkit-min-device-pixel-ratio:0) {
 #diez  { color: red  }

/* iPhone / mobile webkit */
@media screen and (max-device-width: 480px) {
 #veintiseis { color: red  }

/* Safari 2 - 3.1 */
html[xmlns*=""]:root #trece  { color: red  }

/* Safari 2 - 3.1, Opera 9.25 */
*|html[xmlns*=""] #catorce { color: red  }

/* Everything but IE6-8 */
:root *> #quince { color: red  }

/* IE7 */
*+html #dieciocho {  color: red }

/* IE 10+ */
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
   #veintiun { color: red; }

/* Firefox only. 1+ */
#veinticuatro,  x:-moz-any-link  { color: red }

/* Firefox 3.0+ */
#veinticinco,  x:-moz-any-link, x:default  { color: red  }

/* FF 3.5+ */
body:not(:-moz-handler-blocked) #cuarenta { color: red; }


Blank Concrete5 Theme

Hey all, I wanted to open up my blank theme that I use for Concrete5. You’re welcome to download and use it.

It is a simple default setup for Concrete5, every page is blank it has no information in by default so it is easy to modify. The CSS is setup for reseting HTML5 in all the main browsers.

Check it out at

MAMP Pro and OS X Mavericks

If your running MAMP Pro and OS X mavericks I’m sure you’ve had some issues. I found this great post about how to fix it.

Here is the short version.

You just need to open keychain access, click on it’s menu bar item “Keychain Access”, then “Certificate Assistant”, and “Create a Certificate”. For Name, enter your name, Identify Type should be kept as Self Signed Root, and Certificate Type should be code signing. You can pretty much click continue on everything else until your certificate…

run… codesign -v /Applications/MAMP\ PRO/MAMP\ -v”

Credit where credit is do… Thanks Liam Gladdy!


Copyright © 2020 Josh Hagel

Theme by Anders NorenUp ↑