Buscar Valor em Array Multidimensional no PHP

No meu dia a dia de programação, me deparei com o problema de ter que checar se um valor existe numa array multidimensional. No help do PHP tinham alguns snippets, mas não resolviam o problema onde a chave da array era uma string. Logo fiz o seguinte código e deixo ele para quem quiser melhorar.

function in_multiarray($elem, $array)
{
    while (current($array) !== false) {
        if (current($array) == $elem) {
            return true;
        } elseif (is_array(current($array))) {
            if (in_multiarray($elem, current($array))) {
                return true;
            }
        }
        next($array);
    }
    return false;
}

Assim basta procurar pelo item $elem na array multidimensional $array.

Até a próxima!

Usando Google Analytics no Ionic

Código para Configuração (app.js)

function _waitForAnalytics() {
  if (typeof analytics !== 'undefined') {
    $cordovaGoogleAnalytics.startTrackerWithId('UA-80968008-1');
  } else {
    setTimeout(function() {
      _waitForAnalytics();
    }, 250);
  }
};
_waitForAnalytics();

Código para Acompanhamento de Página

function _waitForAnalytics() {
  if (typeof analytics !== 'undefined') {
    $cordovaGoogleAnalytics.trackView('Home');
  } else {
    setTimeout(function() {
      _waitForAnalytics();
    }, 250);
  }
};
_waitForAnalytics();

Uninstalling Java JDK MacOS

To uninstall the JDK, you must have Administrator privileges and execute the remove command either as root or by using the sudo tool.

Navigate to /Library/Java/JavaVirtualMachines and remove the directory whose name matches the following format:

/Library/Java/JavaVirtualMachines/jdkmajor.minor.macro[_update].jdk

For example, to uninstall 8u6:

% rm -rf jdk1.8.0_06.jdk

Do not attempt to uninstall Java by removing the Java tools from /usr/bin. This directory is part of the system software and any changes will be reset by Apple the next time you perform an update of the OS.

Como remover o Android Studio do Mac

Siga os seguintes passos no terminal:

rm -Rf /Applications/Android\ Studio.app
rm -Rf ~/Library/Preferences/AndroidStudio*
rm ~/Library/Preferences/com.google.android.studio.plist
rm -Rf ~/Library/Application\ Support/AndroidStudio*
rm -Rf ~/Library/Logs/AndroidStudio*
rm -Rf ~/Library/Caches/AndroidStudio*

Se você quer apagar todos os projetos:

rm -Rf ~/AndroidStudioProjects

Para remover arquivos relacionados ao gradle (caches & wrapper)

rm -Rf ~/.gradle

Use o comando abaixo para apagar todos os Android Virtual Devices(AVDs) e *.keystore. Nota: Esta pasta é utilizada por outras Android IDE, então se você ainda estiver usando outra IDE, não apague esta pasta)

rm -Rf ~/.android

Para apagar o Android SDK tools

rm -Rf ~/Library/Android*