Learn HTML, CSS, & JavaScript in 60 Minutes

HTML/CSS/JavaScript tutorial for use teaching my students @ theCoderSchool:

 

How to Get the Current Year, Month, and Day as Integers in Python 3 using the datetime Module

Currently working on a project where I need to get the current year, month, and day as integers in Python 3, and noticed that the #1 ranked Google search result for my search resulted in an old answer written in Python 2. While I guess it’s not really a big deal, here is my updated Python 3 code (nothing is different other than the print statements, lol):

# REFERENCE: https://bit.ly/2JtjSto
import datetime
now = datetime.datetime.now()
print(now.year)
print(now.month)
print(now.day)
 

How to Get Year, Month, and Day as Integers from an ISO 8601 Formatted Date String in Python 3 with dateutil

I’m currently working with the Plaid Banking API and need to convert the ISO 8601 formatted date strings returned by the API into easy to work with integers. While I considered writing my own code to handle this, after a quick Google search I found that this is quite easy to do in Python using the dateutil module. So far I’ve only run this code in the repl.it web based programming environment, but I believe this module can be easily installed with the pip package manager by running something like:

$ pip install python-dateutil

The code snippet below mostly comes from a blog post on CodeYarns.com titled How to convert datetime to and from ISO 8601 string, but I did add the parts which I needed specifically (year, month, day):

# REFERENCE: https://bit.ly/2xLIh6I
import dateutil.parser
# Datestring in ISO 8601 format
datetime_str = "2019-01-23T06:17:59.273519"
# Convert to datetime object
some_datetime_obj = dateutil.parser.parse(datetime_str)
# Get Year, Month, and Day as integers
print(some_datetime_obj.year)
print(some_datetime_obj.month)
print(some_datetime_obj.day)
view raw parse_iso_8601.py hosted with ❤ by GitHub
 

Robert Green and The Laws of Human Nature

Stumbled upon this awesome talk at Google tonight on YouTube and just wanted to bookmark it here on the blog so I don’t forget about it.

 

MoneyPhone Support

Dear User,

My name’s Topher Pedersen, founder and developer of MoneyPhone Personal Finance. If you are in need of support, first try simply pressing the nifty chat icon in the bottom right hand corner of the app. Or if the matter is more urgent, simply give us a call–

Support Line: +1 (469) 261-0727

Or send us an email–

Email: chris@topherpedersen.com

Best regards,

Topher Pedersen, founder @ MoneyPhone

 

How to Post Source Code on Your WordPress Blog using GitHub Gists and the GistPress WordPress Plugin

  1. Download gistpress-develop.zip
  2. Install the GistPress Plugin on Your Blog
  3. Copy & Paste the Link to Your GitHub Gist in Your Blog
/*******************************************************************************
*******************************************************************************
*******************************************************************************
How to Post Source Code on Your WordPress Blog using GitHub Gists and the
GistPress WordPress Plugin:
1) Download gistpress-develop.zip
2) Install the GistPress Plugin on Your Blog
3) Copy & Paste the Link to Your GitHub Gist in Your Blog
*******************************************************************************
*******************************************************************************
******************************************************************************/
while (true) {
alert("Creating programming related blog posts just got a lot easier!");
}
 

MoneyPhone Privacy Policy

Privacy Policy

Your privacy is important to me. It is  my (Topher Pedersen) policy to respect your privacy regarding any information I may collect from you on my app, MoneyPhone.


I only ask for personal information when we truly need it to provide a service to you. I collect it by fair and lawful means, with your knowledge and consent. I also let you know why I am collecting it and how it will be used.


I only retain collected information for as long as necessary to provide you with your requested service. What data I store, I will protect within commercially acceptable means to prevent loss and theft, as well as unauthorised access, disclosure, copying, use or modification.
I don’t share any personally identifying information publicly or with third-parties, except when required to by law.


My app may link to external sites that I do not operate. Please be aware that I have no control over the content and practices of these sites, and cannot accept responsibility or liability for their respective privacy policies.


You are free to refuse our request for your personal information, with the understanding that I may be unable to provide you with some of your desired services.


Your continued use of my website will be regarded as acceptance of our practices around privacy and personal information. If you have any questions about how I handle user data and personal information, feel free to contact me (chris@topherpedersen.com).


This policy is effective as of 26 June 2019.

 

# TODO: 3-4 Week Plan for MoneyPhone & the June/July 2019 Pioneer Tournament

  1. Remove the “Yesterday Total Spending” SMS-Text Alert
  2. Stop Counting Pending Payments
  3. Write Code to Account for “Net Money Transfers”
  4. Quit Sending SMS-Text Alerts to Users Which Have Not Yet Linked Their Bank Accounts
  5. Replace Web-App with Landing Page
  6. Launch MoneyPhone for Android
  7. Launch MoneyPhone for iOS
  8. Launch Beta-X Accelerator (and Run YouTube Ads for First Batch)
  9. Acquire Paid Beta Users

UPDATE (6/27/2019): Can cross 1, 2, 4, 5, & 6 off the list.

# TODO:

  • Write Code to Account for “Net Money Transfers”
  • Launch MoneyPhone for iOS
  • Launch Beta-X Accelerator (and Run YouTube Ads for First Batch)
  • Acquire Paid Beta Users

# POSSIBLY ADD TO LIST:

  • Add an event listener that detects whenever the WebView is re-opened and refreshes the app if it has been more than 4 hours.
  • Handle updating spending targets, phone numbers, and toggle switches via ajax without refreshing the entire app

# STUFF THAT WILL PROBABLY NEED TO WAIT UNTIL AFTER THE TOURNAMENT:

  • Try caching the main login.html page with JavaScript localStorage for seemingly faster login speeds, bypassing the main login screen, and then simply fetch the new data in the background while displaying a little spinner wheel in the navbar.
  • Consider re-designing the app
  • Add all the cool new features that I want (fixed expenses, new stats/metrics)
 

Apache-Cordova/PhoneGap Application Error net::ERR_CONNECTION_REFUSED (http://127.0.0.1:5000)

Hello there distraught Apache-Cordova/PhoneGap developer! Quick post here on the blog to help you with this horrible error message. If you happen to be trying to link up your Apache-Cordova/PhoneGap application running in an Android Emulator to a local development server, such as the builtin Python/Flask development server, and have already made sure to enable the cordova-plugin-whitelist, your problem (and solution) is simple: you cannot link up a cordova app running in an emulator to a local development server running at http://127.0.0.1. Instead, you need to use a tool like ngrok to give your local development server its own public web address such as https://yoursupersweetdevserver.ngrok.io which will then make your local development server accessible to your cordova app.

Please note however, I suggest paying the $60 per year for the ngrok basic subscription so that you have a stable web address that doesn’t change. If you try to accomplish this using their free service, you are going to be in for quite the headache constantly changing the url in your codebase every time you run ngrok!

Hope this post helps some other poor souls out there on the interwebs. This bug caused me quite the headache this afternoon. However, I’m feeling much better after figuring out the solution. And shout out to the guys at ngrok. God bless you!

 

The Music that Plays When I Finally Get my Code to Run…