Day 26 – Raining breakfast products

Go to project: Raining breakfast products

It’s been a MONTH (!!) since I last posted something on the blog. By now I should almost be finished with my 100 days. I should only have 20 days left approx. But let’s just say that, that is not the case.

I have been working however, making projects with my BF. So today I will add day 26 and 27, which have been done for some weeks, but never got around to put it on the website and blog.

The challenge and steep steep learning curve of programming has really done a number on me. Mentally it is super challenging, staying motivated and wanting to work everyday. So I haven’t been working every day. And I told my BF that I needed more help, because I don’t feel ready to do this completely alone, yet.

Right now we are working on some more complicated projects, that takes more than 1 day to complete (due to my job), and I have started to think of this project as a 100 programming projects more than 100 days of programming.

This cute little program was inspired by JD, but I changed it up a bit with some breakfast products.

What did I do/learn in this project:

  • Pretty much the same project as this project, but with some minor differences.
  • The different types of rain is controlled with CSS classes.
  • I used a lock variable called isItRaining to make sure that the buttons can’t be pressed again and start another function call.
  • And this would not be possible without everyone’s favorite function getRandomInt.
Advertisements

Day 25 – My first API

Go to project: My first API

Okay, so no big deal, but I just made a website using my first ever API!!!! Whaaaat?! That’s official programmer-stuff! I found a Chuck Norris joke database, that supplied a JSONP API that I decided to use. The internet is a crazy place.

The website has two input fields where you can type in your name (or any name), and it will generate a joke with those names based on the Chuck Norris jokes.

Pretty simple stuff, but I kinda love it. Who am I kidding?! I FREAKING love it!

Definitely more API stuff on it’s way from me.

Lessons learned:

  • The BF gave me a thorough API lesson, helping me figure out how to use it. As far as I know now, I have to use the so called JSONP APIs and not JSON or other, because they require that I can host the API on my own server, which I cannot. So JSONP APIs will not have to be hosted by me.
  • Anyway, I learned about the $.ajax thing, and I cannot explain what it is and why it necessarily works, but in any case it has an object “inside”, that has a bunch of keys (I think it’s called keys) and some of them link to the url of the API. Also it has something called “success” which has a callback function (look at me, using words like callback functions!) that starts IF the data is accessible. If not it also has an error which is an alert.
  • I gathered the joke value from the API and replaced the Chuck Norris with a custom first and last name.