Yoda Speak

I can’t believe it’s been nearly three weeks since I completed the WDI course. In an effort to make sure I’m staying sharp with my coding skills, I’m going to try to complete coding challenges every week and create a new app every month. Will I succeed with living up to those goals? I sure hope so!

I am also combing through my previous class assignments from WDI to try to find ways to refactor my code or polish existing work into more functional applications. So recently I decided to revisit a Yoda exercise we did. Using vanilla JavaScript, I created an application that utilizes the Yoda Mashape API for translating text into Yoda speak.

You can view the live app here and see the Github repo over here.

Yoda Speak

WDI Day Forty: Project Week 3, Part 2

Today proved to be a day of frustration for my group – we’re struggling with Angular quite a bit. I managed to build up the back-end coupled with Angular as the front-end, however I’ve run into issues getting CRUD to function for the API. Update and show are working, it’s just a matter of getting delete and new to work.

After a day of struggling with my code, I’m on the verge of scraping everything and rebuilding. Sometimes you need to cut your losses.

WDI Day Thirty-Seven: Angular, APIs, & Firebase

I’ve reached the conclusion that Angular is hard. It will take some getting used to with running through several exercises before I feel comfortable enough with it.

Today we worked with Angular alongside Rails. It was cool seeing how we can create our own APIs when we need to be able to work with updating the API data. It was weird seeing how Rails as the back-end fits together with Angular as the front-end. We walked through putting together a couple of single-paged applications with the Rails/Angular combo, and I noticed that the Angular server acts a little wonky at times when working on updates.

In the afternoon we walked through working on a SPA with Firebase. Firebase is a Platform as a Service (PaaS), that offers a number of cloud-based computing services, including a realtime database. Firebase uses Websockets to maintain a constant, open connection between the client and the database. We used AngularFire, which is a way to connect an Angular application to a Firebase DB.

Resources

WDI Day Thirty-Five: API’s and AJAX

Earlier this year I took a class in JavaScript development, so API’s and AJAX are somewhat familiar to me. Today I realized that I have a much better handle on these topics when it comes to tackling new projects, however, I’m looking forward to practicing my work with API’s so that I can feel more confident with that type of code.

Application Program Interface (API) is a service that provides raw data for the public. We reviewed how we can create our own APIs so that we can use them for CRUD functionality in apps, which was a pretty fun scenario to take a look at.

Asynchronous Javascript and XML (AJAX) do server side requests asynchronously on the client without having to send an actual browser request that reloads the page.

In class, we played around with the following code to make API requests – and I thought it was a pretty good chunk of code that I could use for future reference when it comes to API-related projects:

$(document).ready(function(){
$("h1").on("click", function(){
var url = "https://api.wunderground.com/api/api_key/geolookup/conditions/q/va/midlothian.json"
$.ajax({
url: url,
type: "get",
dataType: "json"
// $.ajax takes an object as an argument with at least three key-value pairs...
// (1) The URL endpoint for the JSON object.
// (2) Type of HTTP request.
// (3) Datatype. Usually JSON.
}).done(function(){
console.log("Ajax request success!")
}).fail(function(){
console.log("Ajax request fails!")
}).always(function(){
console.log("This always happens regardless of successful ajax request or not.")
})
})
})