The first GitHub Project for an MD

Coming from a medical background to deploying my first Programming Project. The path I followed!

Ces Mejia
Ces Mejia
Aug 28, 2017 · 5 min read

By Dr. César Mejía

Yes, I’m coming from a medical background and suddenly the coding world attracted me like no other. Suddenly, I want to develop medical apps that can make a dent in the world. That’s something I enjoy and that’s something I figured out at my 28’s. Here’s some advice for those with the “programming bug” and the path I followed.

So, yeah, I want to change the world, but here I am deploying my first JavaScript function as I’m working in Prescrypto, a BlockChain encryption company in México that specializes in prescriptions intel and software.

Here I am, the world of developing is just opening for me and I like it every step of the way. My first assignment: Make a google sheets script that sends a mail whenever a mention is made with “@” and deploy it via GitHub. This is the path I followed from zero to successful deploy.

Of course, I come from a reading background from my MD career, so yeah, lots and lots of reading if you want to be successful in coding… or in anything for that matter!

I already knew (self-made) html, css, javascript, jquery, bootstrap and a little bit of Python. For this google script exercise, I only applied the javaScript knowledge.

A little advice for those who want to start learning to code the web from “zero” in 2017… Here are the 3 most helpful links I would recommend to any zero start programming student (in order):

  1. Codecademy: https://www.codecademy.com/ : A free source of interactive learning. Complete the HTML & CSS course and the JavaScript Course. This will teach you the coding syntax or “the way of typing” and will give you a right away satisfaction of writing code. Then…
  2. MDN: Read the all documentation for complete beginners at https://developer.mozilla.org/en-US/docs/Learn/Getting_started_with_the_web and then continue with the all Guide. And then after that:
  3. FreeCodeCamp: https://www.freecodecamp.org/ Only after reading the all MDN documentation, you will be able to do this exercises with absolute freedom! (Otherwise, you will be getting stuck every 2 exercises and will be very frustrating).

So… with this background knowledge, let’s continue…

Read and Learn about everything I need:

  1. What the hell is google scripts? https://www.google.com/script/start/
  2. How the hell am I going to make a cell trigger something when typing @Mention https://developers.google.com/apps-script/guides/triggers/
  3. How am I supposed to send an email? https://developers.google.com/apps-script/articles/sending_emails

So next… First I have to know how to read the data in the cells so… https://developers.google.com/apps-script/guides/sheets

Once you know how to get the sheet and how to get a cell the … triggers!. I have to find a trigger that fires when someone edits something so after a lot of reading…

Ok so… how do I tell the onEdit function that I want only the @Mention part? The answer must be in RegEx!

RegEx is a little bit complicated but going to read to the right place makes it easy so here is the link to RegEx knowledge! https://developer.mozilla.org/en/docs/Web/JavaScript/Guide/Regular_Expressions

Then compare the @Mentions you already filtered from input cells to what you have in a contact sheet:

So, I went with for with a nested for and an If statement… Maybe I should have gone with a more simpler approach but this was a very good exercise (a little over complicated I admit).

The last part of that snippet also sends the email with one very simple line of code.

One important part is the authorization and the use of “installable triggers”, which you can learn here: https://developers.google.com/apps-script/guides/triggers/installable , that led me to this simple snippet activated only once and then give Gmail authorizations for the sending email account.

And then… after a lot of testing and testing and testing for a day… Trial and error it finally could be done! The function worked!

Finally… Deploying to Prescrypto’s GitHub Account… This was a faster reading but here is the link for the Try GitHub Tutorial: https://try.github.io/levels/1/challenges/1.

THE FINAL WORK!!! : https://github.com/Prescrypto/mentionMail

What I want you, the reader, to consider is that from my experience you can do whatever project you want if you have a solid basic knowledge of the programming language (after a lot of reading documentations) and then more reading! Reading how Google does it, how that API does it, how that snippet works… Of course, it helps a lot to be in a modern company like Prescrypto that challenges you with this type of exercises. If you have the will to put the hours in reading you can accomplish this project and whichever you want, even coming from zero knowledge.

)
Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade