How To Uninstall MySQL on Mac OS X

To uninstall MySQL and completely remove it (including all databases) from your Mac do the following:

  1. Open a terminal window.

  2. Stop the database server.

  3. Then run the following commands:

sudo rm /usr/local/mysql
sudo rm -rf /usr/local/mysql*
sudo rm -rf /Library/StartupItems/MySQLCOM
sudo rm -rf /Library/PreferencePanes/My*
rm -rf ~/Library/PreferencePanes/My*
sudo rm -rf /Library/Receipts/mysql*
sudo rm -rf /Library/Receipts/MySQL*
sudo rm -rf /private/var/db/receipts/*mysql*

Linux Instructions are similar:

To uninstall mysql on linux, open terminal and type these commands:

sudo apt-get remove --purge mysql-server mysql-client mysql-common -y
sudo apt-get autoremove -y
sudo apt-get autoclean
rm -rf /etc/mysql
sudo find / -iname 'mysql*' -exec rm -rf {} \;

Auto Dim Your Computer Screen At Night With f.lux App

Use f.lux App to automatically dim your screen at night

Computer screens, tablets and mobile phones emit full spectrum light around the clock, just like the sun. Exposure to blue light at the wrong time of day can keep you awake later and interfere with the quality of your sleep. f.lux tries to help this by removing blue and green light to help you wind down in the evenings.

It can take a few days to get used to the new colors at night, so we recommend setting the night-time colors in f.lux to whatever feels good to your eyes. After a few days with f.lux, experiment with the settings to warm things up a little more and find which color works best for you. Our default setting of 3400K on Windows removes about 3/4 of the blue and about half of the green light.

Probably my favorite app for mac and windows. It’s a must have if you use your computer late at night.

Get f.lux.

How To Clean The Apple Wired Keyboard

How To Clean & Whiten your White Apple Keyboard?

I recently decided to clean my nice Retro Apple Keyboard from all the hair build up over the years. Gross I know. The keys actually pop off very easily. I just used your average dull kitchen knife. Putting the stuff back together is time consuming, but you’ll have a brand new looking keyboard when you’re done.

img_9568

img_9570

You don’t actually have to take it apart all the way like I did. I did it before I found this how to video:

Good luck.

How to use ng-disabled with multiple expression

You may have ran into this issue when trying to bind a submit button with multiple disable conditions. The easiest way to do this is to embed the variable checking in the html as follows:

Both variable must be false for the button to be disabled:

<button class="button" ng-disabled="(!data.var1 && !data.var2) ? false : true">
</button>

Either variable can be false for the button to be disabled:

<button class="button" ng-disabled="(!data.var1 || !data.var2) ? false : true">
</button>

How to Localize Your Ionic Project

How to localize, translate and support multiple languages in your Ionic / AngularJS project:

1. Install Angular Translate:

npm install angular-translate
npm install angular-translate-loader-static-files

2. In your index.html make sure you include the js files:

<!-- translations -->
<script src="js/angular-translate.js"></script>
<script src="js/angular-translate-static-files.js"></script>

If you cannot find these js files in your project folder then you can find them on the project github pages.

3. In your app.js add the translation loading

angular.module('starter', ['ionic', 'starter.controllers', 'pascalprecht.translate'])

.run(function($ionicPlatform) {
  $ionicPlatform.ready(function() {
    // Hide the accessory bar by default (remove this to show the accessory bar above the keyboard
    // for form inputs)
    if (window.cordova && window.cordova.plugins.Keyboard) {
      cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
      cordova.plugins.Keyboard.disableScroll(true);
    }
    if (window.StatusBar) {
      // org.apache.cordova.statusbar required
      StatusBar.styleDefault();
      return StatusBar.hide();
    }
  });
})

.config(['$translateProvider', function ($translateProvider) {
  $translateProvider.useSanitizeValueStrategy('sanitize');

  $translateProvider.useStaticFilesLoader({
      prefix: 'locale/locale-',
      suffix: '.json'
  });

  $translateProvider.preferredLanguage('en');
}])

4. Create a locale json file

Create a file named locale-en.json and a locale folder
the file should be in your www/locale/locale-en.json
Do not include any //comments in the JSON file

{
  "HelloWorld": "Hello World!",
  "Name": "My Name"
}

5. Add localization in your html file

<label>{{ 'HelloWorld' | translate }}</label>

6. Translating within your javascript

Make sure you import $translate within your controller before using it.

 $translate('HelloWorld').then( function (translation){
    console.log(translation);
  });

Or if you need to translate multiple terms:

 $translate(['HelloWorld', 'Goodbye']).then( function (translations){
    console.log(translations.HelloWorld);
    console.log(translations.Goodbye);
  });

For more information visit https://angular-translate.github.io/docs/#/guide.

How to Deploy Your Ionic Node.js app to Heroku

In this tutorial I will explain how to deploy one of my Ionic starters to Heroku with Dropbox. Both dropbox and heroku have a free tier that you can use. If you get serious about your app you can upgrade to heroku professional account which is similar to Amazon’s service but much easier to use.

Prerequisite: Sign up for dropbox.com and download their desktop client. Use one of my ionic starters with a node.js backend or use your own node project.

1. Create an account on Heroku.com

Screen Shot 2016-04-25 at 11.42.05 AM

Continue reading