Run the following command to get the IP addresses of the host machine. You an then use the docker IP address within the container to access the host machine: ip -4 addr
Trash all unused images: docker image prune -a
Sep 5, 2018
Jun 29, 2017
Ubuntu 16 and MySQL Fun
Did a fresh install of Ubuntu 16 LTS on Azure and installed MySQL with defaults (no password). For whatever reason, I could only connect to the database via sudo. I tried all sort of grant options to no avail. Finally this link here helped https://askubuntu.com/questions/766334/cant-login-as-mysql-user-root-from-normal-user-account-in-ubuntu-16-04
Jun 9, 2016
Android Splash Activity "gotcha"
The title might be misleading, but here's the essence of the gotcha. Last year I had an app that would throw some exceptions sometimes on some devices when the app had been in the background for awhile. There were static singleton variables that were created in the "splash" activity, the main entrance activity. This is the one that we use to determine where to take the user (e.g. if the user is logged in, take them to the Dashboard activity; if the user isn't logged in, take them to the Login activity). This splash activity also loaded the current user into a global static var that the subsequent activities would reference.
However - the gotcha is that when your app is killed by the system (most likely due to low memory), the splash activity is bypassed and Android will open up the last activity that was on the stack.
The solution - move the logic for setting the current logged in user into the Application class. The application class is always run before it loads any other activities. You can simulate this by running the following command from adb:
am kill <com.favpix.yourpackage>
Hope this helps someone else out!
Sep 16, 2015
Android Event Bus
We've used Otto for event notification. If you're not familiar with this, it allows your application to subscribe to events and other parts of your application to listed for when those events are fired. Otto was okay for awhile, and still is. It comes with one major caveat - new Android developers don't realize they need to unregister() off the bus when the lifecycle of the view is over - this creates a memory leaks on apps with more than one Activity or Fragment, which causes apps to eventually crash.
One of the items I've been waiting for is either the ability for Otto to get a bit smarter and allow the user to register as a weak reference. A new library, EventBus (also boasting faster performance) has emerged, and one of the outstanding feature requests is to enable this very feature. Hasn't been implemented yet, but something I've subscribed to and am interested in seeing implemented.
One of the items I've been waiting for is either the ability for Otto to get a bit smarter and allow the user to register as a weak reference. A new library, EventBus (also boasting faster performance) has emerged, and one of the outstanding feature requests is to enable this very feature. Hasn't been implemented yet, but something I've subscribed to and am interested in seeing implemented.
Realm.io - Android/iOS Database
Coworker pointed out Realm, a mobile database for Android and iOS. Offers increased performance vs native SQLite databases, on both iOS & Android. In addition, there is a plugin for Stetho so you can view your database inside Chrome dev tools (Stetho is absolutely one of the most useful Android tools I've come across in awhile).
Chuck Norris Quick API
Came across a quick URL to testing hitting up an API (well aware there are roughly over a million of these already).
GET http://api.icndb.com/jokes/random
{"type": "success","value": {"id": 466,"joke": "Chuck Norris doesn't do Burn Down charts, he does Smack Down charts.","categories": ["nerdy"]}}
GET http://api.icndb.com/jokes/random
{"type": "success","value": {"id": 466,"joke": "Chuck Norris doesn't do Burn Down charts, he does Smack Down charts.","categories": ["nerdy"]}}
May 18, 2015
Recommended Podcasts
After having being recently asked some of my favorite podcasts, what better place to record than here. In no particular order.
- This American Life
- Radio Diaries
- Love + Radio
- 99% Invisible
- The Memory Palace
- HBR IdeaCast (nerdy, I know)
- StoryCorps
- Death, Sex & Money
- The Moth Podcast
- StartUp Podcast
- Serial
- Reply All
- Planet Money
- Invisibilia
- Freakonomics Radio
- Criminal
- Radiolab from WNYC
- Criminal
- Every Little Thing
- Hidden Brain
- My Favorite Murder
- Revisionist History
- Science Friday
- Science Vs
- The Daily Show
- The Kevin Rose Show
- The Pitch
- The Way I Heard It with Mike Rowe
- Tribe of Mentors
- Uncivil
- Without Fail
Subscribe to:
Posts (Atom)