Category Archives: Programming

Showing all tabs in sublime

By | December 16, 2019

Sublime is a great text editor. It is fast and powerful but there is one annoying default setting which is all the tabs do not show by default. Instead, they overflow on the right hand side where you have to click on the triangle/arrow to display the other tabs in order to navigate to it.… Read More »

Lite server Couldn’t open browser

By | February 9, 2019

If you are trying lite server and want to open up another browser using the bs-config.json file and you get the following error: “Couldn’t open browser (if you are using BrowserSync in a headless environment, you might want to set the open option to false)” you are probably using a config file of: { “port”:… Read More »

WTF is UTF?

By | December 27, 2018

UTF stands for Unicode Transformation Format. The most popular version is UTF-8 which represents 8 bits or 8 one’s or zero’s. (11111111 -> 00000000). The secret though is that it uses up to 4 bytes. We know that 1 byte = 8 bits so 4 bytes gives us 32 bits. 8 bits can represent 255… Read More »

What does > /dev/null 2>&1 mean?

By | December 15, 2018

Here is a great write up explain what the cryptic symbols mean. https://medium.com/@codenameyau/step-by-step-breakdown-of-dev-null-a0f516f53158 Combine this with command -v to bypass “normal function lookup” from https://askubuntu.com/questions/512770/what-is-use-of-command-command we can use this to check if certain applications exist.

pretty json format in Sublime in 60 seconds

By | October 9, 2018

If you are working with json and want to view it in a pretty format within Sublime, you can install an extension very quickly. The long way on a Mac is to navigate to ~/Library/Application Support/Sublime Text 3/Packages and run this command from a terminal: git clone https://github.com/dzhibas/SublimePrettyJson.git Restart Sublime and the open up some unformatted json… Read More »

OSX Eclipse installer does not contain the JNI_CreateJavaVM symbol error

By | June 16, 2018

If you are trying to install Eclipse and you get the following error: The JVM shared library “/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/../lib/server/libjvm.dylib” does not contain the JNI_CreateJavaVM symbol. You want to: Right click the installer file and select ‘show package contents’ Go to Contents and open Info.plist At the bottom of this file, you’ll see a commented section… Read More »

php hello world on OSX

By | July 10, 2017

Getting a php hello world up and running is very quick in OSX. First of all, everything is there already. Apache and php. To start apache run: > sudo su > apachectl start Then go to http://localhost and you should see: The web directory is /Library/WebServer/Documents If you put hello.php there <html> <head> <title>PHP Test</title>… Read More »

Creating a simple navigation drawer in Android

By | June 26, 2017

There are lots of articles on how to create a navigation drawer in Android but they are all slightly different with some extending ActionBar and some extending Activity. I wanted to extend AppCompatActivity as this is the most up to date version to use. The notes at: https://developer.android.com/training/implementing-navigation/nav-drawer.html are ok but it doesn’t explain step by… Read More »

Learning Android toast the long way

By | June 11, 2017

It is relatively easy to show a toast (a short message that appears on screen for a few seconds and then disappears) with the following code: Toast.makeText(getApplicationContext(), “hi”, Toast.LENGTH_LONG ).show(); The trick is trying to understand how this short hand method was created. This is what it looks like written the long way: Context context;… Read More »