Books I've Read this 2022

My Personal Feedbin Reader - v0.2.1

The name of my personal Feedbin reader is called FeedMe. The more I worked on it the more it feels like this is not an RSS reader app, but a food or recipe app.

v0.2.1 Release

I finally fixed the format alignment in the feed view.

And, the mark as read button is now located at the bottom. For easier reach with anyone who has small hands.

There is still more work to do and I am currently enjoying iterating on the fixes, improvements and features.

My personal Feedbin Reader - v0.2

In three days, I developed my own Feedbin Reader since the official one is not written in native. In other words, it feels so slow.

First commit was on December 7, 2022.

The app is written in SwiftUI and I am just blown away by how fast you could create an iOS app. Compared with Storyboarding or UIKit.

I open sourced for my future reference.

There’s still so much to work on it, so many bugs and critical ones but for now, it is functional for my everyday use. Shoutout to Feedbin for having such an amazing API.

Philippines Top 10 In Pivoting to Clean Energy

According to MIT, the Philippines is one of the countries pivoting towards clean energy. Perhaps we are the only one throughout Southeast Asia? Good to know our leaders here, and past, are not climate change deniers.

Updating old Android codebase

An old client of mine contacted me to fix some bugs and the tricky part was that I have to update an Android codebase that hasn’t been updated in 3 years.

I have updated com.android.tools.build:gradle from v3.6.4 to v4.2.2.

And from v4.2.2 to v7.3.1.

This is how old the codebase is.

GCF on Hacker News

In high school, in me and my brother’s room, I had a vandal of a phrase on my wall saying

On the streets saving the scene from the forces of evil

It came from Good Clean Fun’s hardcore album of the same name. It was one of my favorite albums growing up.

About 2 weeks ago, I came upon a username issa on Hacker News and was talking about some hardcore riffs. The post was about How to write a hardcore riff. When I saw the username, the first thing that came to my mind was Good Clean Fun. And straight up asked him. And I was right.

The awesome part is that he still remembered my email way back in 2007-ish. I interviewed him back then through email.

Thank you Issa and to Good Clean Fun for making my high school soundtrack awesome!

Android Studio Render Problem

If you encounter a Render Problem issue on your Android Studio, like the one below.

The solution I came up with is to use the Material Styles as your app theme.

1
2
<style name="AppTheme" parent="@style/Theme.Material3.Light">
</style>

Reddit Gift

Reddit made an error with their Premium and in turn, they gifted me with 21,000 coins. I would never expect them to even respond or solve this issue.

Android Job Post Nostalgia

Just found this photo of a newspaper ad for an Android Developer job post. This was my first break in the mobile development industry.

This was published back in October 2011. I emailed them my application and was interviewed the next month. And was hired, if I remember correctly, the same month in November that year.

Amazing, I still have that email sent saved.

This is the source code of the app I developed for the demo for the technical interview.

I am eternally grateful to this company for giving me my big brake in the industry.

Xcode 14.1 Beta 3 New Splash?

I just saw this new Xcode splash screen for the first time. This popped up on Xcode 14.1 Beta 3. I’m surprised this wasn’t included in Xcode 14.0?

Had to confirm it on Reddit.

One of the Top Mobile Developers in Cebu

Before this gets purged on the internet or LinkedIn. Back in 2018, someone messaged me on LinkedIn that I was chosen as one of the top mobile developers in Cebu.

Flattered of course. Thanks! But unfortunately, the project was scrapped.

Weekend Project: ImageDownloader.py

My personal project for this weekend is to migrate my portfolio from my old WordPress blog to my current one.

Export

First, I exported my content using WordPress admin. And was saved into a lwgmnzme.wordpress.com-2022-09-25-02_03_10 folder in XML format.

WordPress XML to Markdown

I then used this handy library for migrating all the pages to Markdown.

Curl Option

At first I was downloading each image individually, and it seems I have more than 50 images to process. So this is not an option.

1
curl https://lwgmnzme.files.wordpress.com/2021/02/simulator-screen-shot-iphone-12-pro-2021-02-27-at-17.22.11.png > image1.png

Python Script

Time to brush up my Python skills once again. I downloaded the requests Python library.

1
sudo pip3 install requests

The plan is to be able to input several URLs and maybe prompt a shortcut key or something to cue the script that it’s time to download the images.

Or better yet look for the png URLs inside the .md file? Seems like the most logical option for me.

Initial commit

1
2
3
4
5
import requests

file = open("index.md", "r")
line = file.read()
print("Read = %s" % (line))

So far, so good.

Find all the png files

The next step is to find all the URL images with .png extensions. Time to use Regex I guess.

Update the scripts.

1
2
3
4
5
6
7
8
import requests
import re

file = open("index.md", "r")
line = file.read()

result = re.findall(r'(https?://[^\s]+)', line)
print(result)

Looks promising. Let’s loop through it.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
import requests
import re

file = open("index.md", "r")
line = file.read()

results = re.findall(r'(https?://[^\s]+)', line)

for result in results:
	print(result)

Much clearer. Okay, let’s try downloading each one of them. But, wait I noticed an extra ) character on the results. The hell.

Maybe I should remove the extra ?w= while I’m at it too.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
import requests
import re

file = open("index.md", "r")
line = file.read()

results = re.findall(r'(https?://[^\s]+)', line)

for result in results:
	indexOfPng = result.find("?")
	updatedResult = result[:indexOfPng]
	print(updatedResult)

Not the most elegant of solutions but it worked.

Get the filename

The plan is to get the filename from the URL and use it for saving as a file.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
import requests
import re
import os
from urllib.parse import urlparse

file = open("index.md", "r")
line = file.read()

results = re.findall(r'(https?://[^\s]+)', line)

for result in results:
	indexOfPng = result.find("?")
	updatedResult = result[:indexOfPng]
	# Get the filename
	parse = urlparse(result)
	print(os.path.basename(parse.path))

Time to download

I was having a IsADirectoryError trouble. And it seems that I need to filter out to download only files coming from a wordpress.com domain.

Final code

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import requests
import re
import os
from urllib.parse import urlparse
from urllib.request import urlopen

file = open("index.md", "r")
line = file.read()

results = re.findall(r'(https?://[^\s]+)', line)

for result in results:

	# Filter only Wordpress domains
	if "wordpress.com" in result:
		# print(result)
		# Create folder
		if not os.path.exists("images"):
			os.makedirs("images")

		# Remove unnecessary characters in the URL
		indexOfPng = result.find("?")
		updatedResult = result[:indexOfPng]
		# print(updatedResult)

		# Get the filename
		parse = urlparse(result)
		filename = os.path.basename(parse.path)

		# Create a file path
		filePath = os.path.join("images", filename)
		print(filePath)

		request = requests.get(updatedResult)
		with open(filePath, "wb") as file:
			file.write(request.content)

My Wife's Pregnancy Journey

Just happen to see this picture again in my photo library and I am still amazed at how strong my wife is. These were her medications after her C-section.

I can’t even take two medicines in a day without losing my shit.

So proud of her!

SwiftUI: How to use NavigationStack inside the .toolbar

First, why do I mostly find a solution after posting a Stackoverflow question?

So most examples and tutorials only use NavigationStack and NavigationLink inside a List. I’m surprised by how nobody seems to implement using the .toolbar modifier.

The solution was a little straightforward I found out.

Instead of NavigationView, you use the new and shiny NavigationStack. And use .navigationDestination() instead of NavigationLink.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
@State private var goToSettings = false

NavigationStack {
   ZStack {
      // Some more codes
   }
   .toolbar {
      Button(role: .destructive, action: {
         goToSettings = true
      }) {
         Label("Settings", systemImage: "gearshape.fill").foregroundColor(colorForeground)
      }
   }
   .navigationDestination(isPresented: $goToSettings, destination: {
       SettingsView()
    })
}

I need to get more familiar with SwiftUI’s modifiers as it is still a little confusing for me.

BuildException Error

Updated last night to the latest Android Studio Dolphin build but encountered this annoying build error from the JetBrains IDE.

Invalidating cache and restarting seems to not work. Jetbrains seems to be clueless too.

This bug has already taken much of my time. This is annoying.

Edit: September 17 at 9:14PM

It seems that the error went away after declining the “standalone script” option in Android Studio.

Compiling iOS Project in GitHub Actions

While setting up YAML with GitHub Actions, it seems the build failed.

These are the steps I took to integrate GitHub Actions in our iOS project. It seems for CI/CD to work we have to create a Package.swift file in our project. Currently, we do it manually through Xcode’s Swift Package Manager.

To create this Package.swift file, we need to run swift package init in the command line and it will create the following files.

1
2
3
4
5
6
7
8
9
swift package init
Creating library package: iOS
Creating Package.swift
Creating .gitignore
Creating Sources/
Creating Sources/iOS/iOS.swift
Creating Tests/
Creating Tests/iOSTests/
Creating Tests/iOSTests/iOSTests.swift

After, I opened Package.swift file and added the libraries inside the dependencies bracket.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
dependencies: [
        // Dependencies declare other packages that this package depends on.
        // .package(url: /* package url */, from: "1.0.0"),
        .package(url: "https://github.com/scinfu/SwiftSoup", branch: "master"),
        .package(url: "https://github.com/onevcat/Kingfisher", branch: "master"),
        .package(url: "https://github.com/realm/realm-cocoa", branch: "master"),
        .package(url: "https://github.com/optonaut/ActiveLabel.swift", branch: "master"),
        .package(url: "https://github.com/mixpanel/mixpanel-swift", branch: "master"),
        .package(url: "https://github.com/BastiaanJansen/toast-swift", branch: "main")
    ],

After saving, run swift package resolve in the command line. Swift will then fetch the libraries and compile them. Swift will also create a file called Package.resolved.

Also, as of September 15 using macos-latest as the runner in GitHub Actions won’t work. So I have to use macos-12 instead. I got this answer from here.

Push to git repo. xcodebuild is now working and seems to be fetching the libraries now but threw another error about my “provisioning profiles not found”. I don’t need those profiles setup for now, I just want GA to compile our iOS project successfully.

So, I updated the run command in our YAML file.

1
2
3
- name: Build
     run: xcodebuild clean build CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO -scheme OnlineJobsPH
     working-directory: ./iOS

Build successful. Yay!

OnlineJobs is iOS 16 Ready

I just compiled our codebase to the latest Xcode 14 RC and everything looks good during testing. I am still not sure how I feel about the new iPhone 14’s Dynamic Island. It seems like a huge black unknown mass floating on the top. I am on a simulator though so, take my opinion with a grain of salt.

With that being said, time to publish this build today and for Apple to review.

Our Son Turned 4

Our kid turned 4 this week. We came back to the hotel where he was still tiny. Where we had to request a crib for our room.

But now we can’t believe he’s 4 now!

Sorry for the table shot, but I captured this perfect moment of them hugging. Our son is on the autism spectrum but it doesn’t mean he won’t show his appreciation and love to us.

The next day’s aftermath, he can’t wait to play with his new toys.

Stackoverflow Chat Recent History Backup

I just want to post my Stackoverflow recent chat history for nostalgic purposes. I hope that day never comes when Stackoverflow would also sunset their chat feature just like they did with developer profile.

I joined the Android channel around 2012-ish. Hopefully, Stackoverflow would let me download the whole history one day.

Legacy Android Library - Networking Valley

7 years ago I open-sourced my first Android library on GitHub.

And shared it to my fellow Android devs in Stackoverflow’s Android channel.

This is for sure one of my favorite highlights of my career.