Josh Hagel

Author: Josh Hagel (page 1 of 3)

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

Stormy day in Spokane

We had a pretty good little storm come through Spokane today. I’m actually writing this on my phone in the dark.
Here are some pictures.



















Yii2 File Manager

So one of the most common problems I’m running into is file management for my projects.

My solution is to build a Yii2 File Manager. This will be an open source project hosted on GitHub @

There are several problems I’m looking to overcome.

  1. Universal File Management
    1. Allow files to be managed for your entire website in one place
    2. Simple implementation of file upload
    3. Central location for files to be stored
  2. Cloud based storage
    1. Enable CDN storage on Amazon S3
    2. Allow for files to be added over multiple means then scanned
  3. SEO friendly information
    1. Store and Pull file information from database to allow for site-wide updates.
    2. Widget for adding images that formats for best SEO practices.
  4. WYSIWYG integration.
    1. Integrate into multiple text editors for simple addition of images

This is the start of the filesystem… I’m sure the scope of the project will extend as it grows.

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; }



Copyright © 2020 Josh Hagel

Theme by Anders NorenUp ↑