Implement a custom Variant type that can hold either string or int while satisfying the JSON Marshaler and Unmarshaler interfaces to support correct encoding/decoding of the values.
NPM/Yarn 404 Error when Building Docker Image
Sometimes the following error appears on Ubuntu Linux when building docker images for nodejs projects and the project includes privately scoped node packages.
|
|
Initial workaround
The initial naive workaround we used was to manually change our DNS entry in /etc/resolv.conf to point to the local gateway.
/etc/resolv.conf
Then manually stop the systemd-resolved service.
|
|
How to build the Golang Bitcoin Node for Windows 10 (btcd)
The latest btcd release build is from 2015. There is a nice description how to build it for Linux/Mac, but for Windows it’s suggested to download the latest binaries, which are 626 commits behind master as of February 2018. Fortunately, with Golang we can easily build binaries for Windows, and we can follow the steps of the Linux build process. The only issue I faced was a problem in the Glide dependency manager and that’s how this little post was born.
Update Go version on Linux
1. Download the latest (or desired) Go version
|
|
2. Remove old installation
|
|
3. Extract archive into /usr/local/go
|
|
4. Test if everything is OK
|
|
Clean up disk space taken by Docker
Show disk space used by docker images, containers and volumes.
The docker prune command may be used with some docker objects like images, containers and volumes to free unused disk space.
Free space used by containers.
|
|
Free space used by volumes.
|
|
In addition, you can use the docker system prune command to clean up multiple types of objects at once.
|
|
Disable Middle Mouse Button in Ubuntu
Run the following command in terminal:
|
|
source: askubuntu.com
Start Android Emulator From Terminal
By default the emulator is installed in ~/Library/Android/sdk/tools. To list all available Android Virtual Devices (AVD), use the following command:
Run the following command to start the emulator from terminal:
|
|
Check out the docs for more emulator commands and flags.
Android 7+ Trace Files Location on Nexus 5X
The location where android trace files are stored on Nexus 5X with Android 7.0 is
|
|
After using the os.Debug class to generate trace files for an app
the file can be pulled from the stored location like
|
|
Useful Android ADB Commands
Show all events happening in the phone. The command is very useful for debugging transitions between activities, background, Home button, launcher icon start, notification icon start, etc.
|
|
Show current tasks and activities running on your connected device:
|
|
Android ListView Optimizations
These tips are gathered from articles and Google IO videos. The items are not ordered by importance.
1. Reuse convertView
Always reuse convertView. This can improve the performance of ListView scrolling up to 50-60% percent, especially when ListView items are complex.
2. Use the Holder pattern if possible.
3. Remove realtime computation of the scrollbar thumb size
|
|