<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: David Moe</title>
    <description>The latest articles on DEV Community by David Moe (@logicxd).</description>
    <link>https://dev.to/logicxd</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F113452%2F4bfad9d6-f515-46f2-bb70-f72ee6b4782f.jpeg</url>
      <title>DEV Community: David Moe</title>
      <link>https://dev.to/logicxd</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/logicxd"/>
    <language>en</language>
    <item>
      <title>Combine Email Bills Using Gmail API (Dropped)</title>
      <dc:creator>David Moe</dc:creator>
      <pubDate>Thu, 07 Jan 2021 17:36:11 +0000</pubDate>
      <link>https://dev.to/logicxd/combine-email-bills-using-gmail-api-1714</link>
      <guid>https://dev.to/logicxd/combine-email-bills-using-gmail-api-1714</guid>
      <description>&lt;h2&gt;
  
  
  Reason for Dropping the Project
&lt;/h2&gt;

&lt;p&gt;After a couple of months, I ran into a few difficulties that would require me to re-think my logic for writing scripts like this. &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The refresh token expires after 7 days so you'd have to keep requesting token. This means this is not really automated anymore. For long lasting accounts, you could use a service account but this requires a GSuite account.&lt;/li&gt;
&lt;li&gt;Found out about Google App Scripts. I'm in the process of migrating all this work into Google App Scripts.&lt;/li&gt;
&lt;/ol&gt;




&lt;p&gt;I wanted to automate combining monthly bills to share it with your roommates so I created this script. Let me know what you guys think!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/logicxd/Combine-Email-Bills-Using-Gmail-API"&gt;https://github.com/logicxd/Combine-Email-Bills-Using-Gmail-API&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Preview from GitHub
&lt;/h2&gt;

&lt;p&gt;Customizable and extensible way of collecting all your bills before sending out an email with a final receipt to your recipients.&lt;/p&gt;

&lt;p&gt;From emails in your inbox:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--COx4SeUN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://user-images.githubusercontent.com/12219300/103873116-2dd87e00-5084-11eb-8ab6-d4c1b7be8ec6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--COx4SeUN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://user-images.githubusercontent.com/12219300/103873116-2dd87e00-5084-11eb-8ab6-d4c1b7be8ec6.png" alt="Inbox Emails"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To sending out:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--MaDDBFUl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://user-images.githubusercontent.com/12219300/103457672-18470b00-4cb6-11eb-9e84-5c69af90e90a.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--MaDDBFUl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://user-images.githubusercontent.com/12219300/103457672-18470b00-4cb6-11eb-9e84-5c69af90e90a.png" alt="Composed Email"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  How It Works
&lt;/h2&gt;

&lt;p&gt;General idea:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Fetches Gmails with the labels you provided.&lt;/li&gt;
&lt;li&gt;Runs each email through the scripts (that you provide) to parse the amount. This includes reading and attaching files!&lt;/li&gt;
&lt;li&gt;Adds any additional custom scripts that you may have.&lt;/li&gt;
&lt;li&gt;Finally, composes an email using the parsed data to create a "final" receipt to send to your recipients.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;An example of how I use it:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;I get utility bills on my primary email account.&lt;/li&gt;
&lt;li&gt;Forward them to my dev email account. This is to limit what emails you can access using Google API for safety.&lt;/li&gt;
&lt;li&gt;Create filters to label my utility bills by water and electricity.&lt;/li&gt;
&lt;li&gt;Write email scripts to extract the amount.&lt;/li&gt;
&lt;li&gt;Download code on my raspbery pi and schedule it to run every month to send me monthly aggregated bills 🎉.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Check out the &lt;a href="https://github.com/logicxd/Combine-Email-Bills-Using-Gmail-API"&gt;GitHub repository&lt;/a&gt; for a more extensive writeup.&lt;/p&gt;

</description>
      <category>gmail</category>
      <category>api</category>
      <category>node</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Programming on the iPhone with Shortcuts</title>
      <dc:creator>David Moe</dc:creator>
      <pubDate>Wed, 17 Jul 2019 08:30:12 +0000</pubDate>
      <link>https://dev.to/logicxd/programming-on-the-iphone-with-shortcuts-4og1</link>
      <guid>https://dev.to/logicxd/programming-on-the-iphone-with-shortcuts-4og1</guid>
      <description>&lt;p&gt;Once in a while, on the weekends, I wake up with the urge to check out what new apps are on the App Store. And this past weekend, I stumbled upon Shortcuts.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Shortcuts?
&lt;/h2&gt;

&lt;p&gt;Shortcuts allow you to integrate different apps and automate actions together. If you're familiar with &lt;a href="https://www.alfredapp.com/" rel="noopener noreferrer"&gt;Alfred&lt;/a&gt;, it is similar to Alfred Workflows. And how you build your actions and events is very similar to the &lt;a href="https://scratch.mit.edu/" rel="noopener noreferrer"&gt;scratch&lt;/a&gt; interface. Shortcuts was developed by Apple and it was previously called Workflow. Now you know why I brought up Alfred Workflows 😃.&lt;/p&gt;

&lt;h2&gt;
  
  
  So What Can You Do?
&lt;/h2&gt;

&lt;p&gt;There are tons of things you can do with it. Here are a few:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.icloud.com/shortcuts/61b2a783fd9d4b10b8832e0ee5bd77b5" rel="noopener noreferrer"&gt;Send ETA with a button press&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.icloud.com/shortcuts/fd6eb0568bcc45c9b6d962d206f2b3da" rel="noopener noreferrer"&gt;Share Location&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://shortcutsgallery.com/shortcuts/ios-download-manager/" rel="noopener noreferrer"&gt;Download files on the iPhone&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Send pre-defined text message&lt;/li&gt;
&lt;li&gt;And many many more&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can find a whole list of Shortcuts that other people have posted on &lt;a href="https://shortcutsgallery.com/" rel="noopener noreferrer"&gt;ShortcutsGallery&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Making Your Own
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw6z75c6nsejcynfx32me.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw6z75c6nsejcynfx32me.png" alt="Shortcuts" width="615" height="659"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;These are pretty self explanatory if you have some experience with programming. You can do everything from setting variables, using variables, asking for user input from an input dialog, or show input result.&lt;/p&gt;

&lt;p&gt;What makes Shortcuts so powerful is that you can integrate with many native apps. This gives it an edge over &lt;a href="https://ifttt.com/" rel="noopener noreferrer"&gt;IFTTT&lt;/a&gt; which mainly gives you access to other published apps. I personally use both IFTTT and Shortcuts to suit my needs. Customize what you want and automate those repetitive tasks!&lt;/p&gt;

</description>
      <category>ios</category>
      <category>productivity</category>
      <category>tools</category>
      <category>automation</category>
    </item>
    <item>
      <title>Xcode Debugging Techniques You Should Know</title>
      <dc:creator>David Moe</dc:creator>
      <pubDate>Mon, 04 Mar 2019 07:34:23 +0000</pubDate>
      <link>https://dev.to/logicxd/xcode-debugging-techniques-you-should-know-4jde</link>
      <guid>https://dev.to/logicxd/xcode-debugging-techniques-you-should-know-4jde</guid>
      <description>&lt;p&gt;Whether you are looking for bugs, figuring out how the code flows, or experimenting your new feature, knowing how to use the debugger will save you a lot of time. I use the debugger basically every single time I run my application. It is also an excellent tool to use to learn how programming works. I just wish school taught this in my early beginner computer science classes. Instead, I was first introduced this after two years when I did my first internship.&lt;/p&gt;

&lt;p&gt;These are some debugging techniques that I use the most. I highly recommend reading through &lt;a href="https://www.objc.io/issues/19-debugging/lldb-debugging/"&gt;objc.io's debugging tips&lt;/a&gt; for a more inclusive reading.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Basics
&lt;/h2&gt;

&lt;p&gt;Quick overview of the basics. You need to know this. Period.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Step Over - execute the current line and stop before executing the next line.&lt;/li&gt;
&lt;li&gt;Step In - go inside the method at the current line. If it's already run, finish
executing the current line and stop before executing the next line.&lt;/li&gt;
&lt;li&gt;Step Out - finish executing the current block and return to the caller.&lt;/li&gt;
&lt;li&gt;Conditional Breakpoints - hit breakpoint only if it satisfies the condition.&lt;/li&gt;
&lt;li&gt;Automatically Continue Breakpoints - executes the expression in the breakpoint
and then continue automatically.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;po&lt;/code&gt; - print out details about the variable. &lt;code&gt;po myVariable&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;e&lt;/code&gt;, &lt;code&gt;expr&lt;/code&gt;, &lt;code&gt;expression&lt;/code&gt; - execute the command. &lt;code&gt;e myVariable = @"new"&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;e UIView *$view = (UIView *)0x0000&lt;/code&gt; - create a variable while debugging.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  All Objective-C Exceptions Breakpoint
&lt;/h2&gt;

&lt;p&gt;Catch it before the crash. This exception breakpoint is a major life saver. When there is an exception thrown, the application will just crash and give you the error stack trace in the Xcode output. When this is enabled, you will hit a breakpoint right at the line before the application crashes. Then you can look at your variables and see what's exactly going on that's causing the crash.&lt;/p&gt;

&lt;p&gt;To turn it on:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open up the Navigator&lt;/li&gt;
&lt;li&gt;Click on the 'Breakpoint navigator' tab&lt;/li&gt;
&lt;li&gt;Click on the '+' sign at the bottom to make a new 'Exception Breakpoint'&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That's all it is! But you can do more to get the most out:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;When the breakpoint hits, set it so that the exception will print out the
error message from running this command: &lt;code&gt;po $arg1&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Set exception on 'Objective-C' only. This will ignore any C++ exceptions if
you don't want to see them.&lt;/li&gt;
&lt;li&gt;Right click and move breakpoint to User to keep this breakpoint across all your
projects!&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Return from a Method
&lt;/h2&gt;

&lt;p&gt;Examples: &lt;code&gt;thread return&lt;/code&gt;, &lt;code&gt;thread return NO&lt;/code&gt;, &lt;code&gt;thread return myVariable&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Great for stubbing methods. Quickly return from a method with the value that you want. Let's say that you wanted to test this method that can return multiple values. Instead of changing the value, re-compiling and running it, you can just put a breakpoint here and return the value that you want!&lt;/p&gt;

&lt;h2&gt;
  
  
  Skip/Jump Executing Lines
&lt;/h2&gt;

&lt;p&gt;Examples: &lt;code&gt;thread jump --by 2&lt;/code&gt;, &lt;code&gt;thread jump --line 102&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;I use this when I want to skip something from executing. This doesn't always work flawlessly though as LLDB doesn't like skipping lines too much. Also, Xcode IDE will not know that you skipped line until you step over to the next line.&lt;/p&gt;

&lt;h2&gt;
  
  
  Import UIKit
&lt;/h2&gt;

&lt;p&gt;Example: &lt;code&gt;e @import UIKit&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;You hit a breakpoint and you want to print a view's bounds by calling &lt;code&gt;po view.bounds&lt;/code&gt;. Instead of getting the view's bounds, you may have gotten some garbage output such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;error: unsupported expression with unknown type&lt;/li&gt;
&lt;li&gt;error: 'bounds' has unknown return type; cast the call to its declared return type&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To fix it, you may have called it by calling it as a method and also specify the return type by doing &lt;code&gt;po (CGRect)[self bounds]&lt;/code&gt;. Well, instead of typing all that mess every time you want to print something, you can just do do &lt;code&gt;e @import UIKit&lt;/code&gt; and you will be allowed to do &lt;code&gt;po view.bounds&lt;/code&gt; and all the other methods that comes with UIKit.&lt;/p&gt;

&lt;h2&gt;
  
  
  Update UI Changes
&lt;/h2&gt;

&lt;p&gt;Examples: &lt;code&gt;e (void)[CATransaction flush]&lt;/code&gt;, &lt;code&gt;caflush&lt;/code&gt; (with &lt;a href="https://github.com/facebook/chisel"&gt;chisel installed&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;Great for testing UI changes on the fly without having to restart after each change.&lt;/p&gt;

&lt;h2&gt;
  
  
  Snapshot of a View
&lt;/h2&gt;

&lt;p&gt;Example: &lt;code&gt;visualize myView&lt;/code&gt; (with &lt;a href="https://github.com/facebook/chisel"&gt;chisel installed&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;Wondering what the view looks like? Just run this command and it'll open a snapshot image of your view on Preview.app.&lt;/p&gt;




&lt;p&gt;I don't use all of these all the time, but they are used more often than other techniques that you may have seen. I will update these as my preferences are changed or I learn something new. Let me know if I should be using something and it's missing from this list.&lt;/p&gt;

</description>
      <category>ios</category>
      <category>debugging</category>
      <category>tools</category>
      <category>tips</category>
    </item>
    <item>
      <title>Things I Didn't Know About Being a Developer</title>
      <dc:creator>David Moe</dc:creator>
      <pubDate>Tue, 22 Jan 2019 07:23:10 +0000</pubDate>
      <link>https://dev.to/logicxd/things-i-didnt-know-about-being-a-developer-cib</link>
      <guid>https://dev.to/logicxd/things-i-didnt-know-about-being-a-developer-cib</guid>
      <description>&lt;p&gt;I recently started my first full-time job as a software developer. There were some things I realized that were different than what I had first thought about a typical developer as well as some that never crossed my mind before. Even though I had worked before as a part-time, I was juggling between my academics and work so I never never realized these things. So these are some of my experiences that I think will help current students and new grads.&lt;/p&gt;

&lt;h2&gt;
  
  
  Get Ready to Communicate
&lt;/h2&gt;

&lt;p&gt;It's not that I hate communication, I really don't. To be able to walk over to your co-worker's desk to talk and solve problems is part of the reason why I left my previous job, which was going to be all remote work. But I didn't know communication would be &lt;em&gt;so important&lt;/em&gt;. Most of the tales I've heard about being a programmer (mine included) was mostly being left alone to do your coding and finish your tasks so this was surprising to me. Maybe I just wrongly assumed that being left alone meant you don't communicate when you're just doing that through chat or calls.&lt;/p&gt;

&lt;p&gt;You have to do lots of explaining and detailing. There were many cases where I would go over how the code works, how it was debugged, and what my thought process was. My goal is to try to say only the bare minimum that they need in order to understand what it is that they're looking for. Which also meant, learning to control my urge to pick at every minor thing that I see and knowing when to stop. Let's just say it's a work in progress.&lt;/p&gt;

&lt;p&gt;Listening and understanding to people's explanations. Just coming straight out of college, most people I've had to work with were around my age and were usually from the area. At work, you may see talented people from all over the world with different background, ethnicity, and age. So working on understanding them and the task at hand is a very important skill to have.&lt;/p&gt;

&lt;p&gt;You're going to be practicing public speaking skills. From standup meetings to performing demos, you'll have to do public speaking. And as you get more and more experienced, you'll be passing on the knowledge to others in the form of classes. So if you're shy, like me, be ready to try to overcome your fears. It does get better over time though.&lt;/p&gt;

&lt;p&gt;If you want to work closely with the customers, you can try being a Software Consultant. They work closely with the customers, getting the requirements, providing suggestions, and demoing. You also have to talk with other developers on top of this, probably the most communicative job as an early to mid level developer.&lt;/p&gt;

&lt;h2&gt;
  
  
  Be Prepared Before Asking for Help
&lt;/h2&gt;

&lt;p&gt;Your co-workers and seniors are usually willing to help you. They &lt;em&gt;want&lt;/em&gt; to help you. It's just that sometimes it's easier to ask for help than trying your best first. If your question is project-specific that only the people who have worked in it may know, then it's no problem to ask. If it's problem solving, I try to follow these steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Did I try solving it in at least 3 different ways?&lt;/li&gt;
&lt;li&gt;Did I take a break and then come back to it?&lt;/li&gt;
&lt;li&gt;What questions might my seniors ask and do I have answers for them?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Number 1 and 3 are self explanatory. They're just there to keep you thinking about the problem. Number 2 because sometimes taking a break lets you see things a bit differently. Kind of like how you would write an essay and then later come back to it and become amazed at how bad you wrote it. &lt;a href="https://www.brainscape.com/blog/2016/08/better-learning-focused-vs-diffuse-thinking/"&gt;Here's&lt;/a&gt;  an article if you want to read more about it.&lt;/p&gt;

&lt;p&gt;After you figure it out without any help, ask seniors to help double check your work. This step is probably the most important as this will introduce you to other ways of problem solving that you may not have been aware of before.&lt;/p&gt;

&lt;p&gt;Sometimes you need to get things done fast and in these cases, it would be better to ask for help than to spend time trying to solve it yourself first. If there's a knowledgable developer free to help you that cuts down the time it would take you, then go for it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Developing New Code vs Maintaining Old Code
&lt;/h2&gt;

&lt;p&gt;Developers at a company just starting off will do a lot of initial design process and producing new code. Bigger companies usually already have products that have been made and done so they'll be building on top of existing code to maintain them.&lt;/p&gt;

&lt;p&gt;While both skills are essential, developing new code may be more rewarding for less experienced developers. Developing new code will help with your growth in the beginning but it may get harder since you don't have much reference of good coding practices. On the opposite side, maintaining old code is harder to do in the beginning but you'll have a better knowledge after getting through them with help from already-written code.&lt;/p&gt;

&lt;p&gt;Doing side projects can help you grow stronger in the weaker area. So if you're doing a lot of development already, you can look into open source projects to contribute to get you more practice. On the other hand, if you're already doing a lot of maintaining code, you can develop some apps on the side.&lt;/p&gt;

&lt;h2&gt;
  
  
  Your Team is Not Only The Developers
&lt;/h2&gt;

&lt;p&gt;Most of the time, you'll be learning from your development team but there are a lot of other things you can learn from other department as well. Seeing how testings are done by the QA team will help you prevent bugs. Learning how the designs are made will help you think about better UI/UX designs. One of the tips that I got was to talk to the QA that will be responsible for checking your work so you can catch them early and save time by having less back-and-forth status updates.&lt;/p&gt;

&lt;h2&gt;
  
  
  Continuing Your Education
&lt;/h2&gt;

&lt;p&gt;I wasn't going to put this section here on this blog but I am going to do it because of how critical this is. I knew that I would have to keep learning to keep up with the new tech in the field but once you're out of school and you start working, it seems like it's on a whole other level. It's not stressful as studying for exams, but the way you learn and study your materials is changed.&lt;/p&gt;

&lt;p&gt;You have to look for resources to learn from. I try to listen to podcasts, read articles, and talk to my friends to learn new information. Because you're not getting the material from your professors who are explaining it to you, it's up to you to make sure that you challenge yourself.&lt;/p&gt;

&lt;p&gt;Know that you'll have to learn and experiment with different technology for the rest of your life. It sounds like it's a lot of work and tiring but it shouldn't feel too much like extra work if you enjoy the material. With computer science being so diverse, I'm sure you'll be able to find something that you'd enjoy doing.&lt;/p&gt;

</description>
      <category>career</category>
      <category>beginners</category>
      <category>tips</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
