Saturday, June 13, 2015

So many lemons, so much salt, and not a damn bit of tequila to go with them.

Networking, networking. It still hasn't happened. Talking to people online hasn't worked out like I wanted it to. I'm too shy, and don't have enough to talk to anyone about.

I went into FreeCodeCamp with an open mind, wanting to learn from everyone and maybe teach someone something in return one day, but they kept revising their course, which is understandable. They're new. But...in the process I fell in the cracks. I can't be on all day to catch people since I have tortoise internet a good part of the month. I can't watch the coding streams they have on Twitch, and when I do go to the chat room most of the people seem way ahead of this and I'm not always sure why they're there, except to get experience...but they mostly live in big cities where they can do meetups and stuff like that.

It reminds me of when I was taking online Japanese lessons and most of the students were living in Japan teaching English. I just sort of go "Really people?" The funny part was their Japanese was worse than mine, landlocked never been off the continent me.

They switched up the discussion board too and that threw things off. I had gotten a short thread going about people in Western NC, but it looked like not a lot of people in the area were studying this stuff, so it died before the board even changed. I checked maybe a month ago and didn't see much new activity. That's why I feel like this place is so depressing. Still in the last century. I don't know what I'll do if I can't get an internship somewhere. Asheville meetups are mostly Wordpress and small. But there's supposed to be some tech stuff going on there...I just can't find it. There's just not a lot of cities around here.

I've wanted to get at least a part time job or something flexible enough that I can keep going to school. I know I need money. But when I was working full time post college, I didn't think I could handle school at all. I went for years wondering if I could do it and then not trying because of the price and everything else. I'm scared if I get into an 8 hour a day thing I won't try to code ever again, and I'll die in this wasteland. I've already let things slip once, I can't do it again. I don't have time.

My hope is to find a job in Asheville, a store job or something part time. That will shut mom up and justify me driving there. Go to the CC there and pray that they're better connected than the school in Hickory. Get work study experience, build portfolio/personal site, hopefully find my way into some business that needs a front end coder. When I get more experience, move the hell away from here. If I can get some agency experience as a junior, maybe I'll start doing freelance things on the side, but right now I know I have no selling skills to develop a client base.

Alternately, when the damn Exede contract runs out in August, we can get regular old cable broadband and I can do stuff during the day again, including more work at home stuff. I think about what I could make if I didn't have to wait so long between clicks and I get angry. While I'm waiting for a page to load, jobs are getting snatched up. That slow connection screws you in so many ways that spill over into your real world life. And everyone assumes you can hop on and off as you please. I'd like to see what they say after a month of the crap I've been dealing with for two years. My grandparents have Charter, and there's a box over there. Hopefully this house isn't too far away from it to extend a line. The house has had it before according to the woman I talked to at the cable office a lifetime ago, so it shouldn't be a problem.

I can only hope. That's the sad state of my life at the moment. I should try to do something productive now. My open bandwidth time is almost over.


Learning to create a dropdown menu with jQuery: Post lesson breakdown

Late night working on Treehouse things. This is more for myself than public consumption, so it might be insanely confusing, since I'm not showing all of the code.

Tonight I was finishing up the mobile dropdown menu project. I learned some new jQuery methods, and I understand it, but my mind tries to figure out some of the in between things that it probably shouldn't concentrate on.

I sprinkled a generous amount of comments on the code as I worked through it, but I wanted to hash it out in prose form too, hence this post.

The page was already made, so the HTML and CSS were mostly done. Some things are added to the CSS to style the HTML elements adds via jQuery.

First, the HTML elements are added dynamically with jQuery. The original HTML page isn't touched at all. For example, I add a select element and assign it to a variable in the js file using:

    var select = $("<select></select>");

That way I don't mess with the original structure. It makes this added feature more portable as well. That's how I'm seeing it, anyway. Otherwise each page in the site would have to be edited, and that only leads to bad things.

Second, the script runs through the tabbed navigation links and adds them to the select element as separate options. This is done with the .each() method and an anonymous function. It's a for loop that runs on each link in the menu.

The function grabs the link and creates an HTML <option> element. In the original HTML, the menu option for that page had a class called .selected added to it. This highlighted the tab at the top of the page. Since we want a drop down menu now, the selected page has to show in the little window. To do that, we check if the link on the page has the .selected class. if so, the selected property of the <option> element is set to true. This will maek it show in the window. The check is done with the hasClass() method.

        if (anchor.parent().hasClass("selected")){
            option.prop("selected", true);
        }

The function then it makes the option text whatever text was in the original link. So if the link was named Home, Home would become the option in the dropdown list.

    <a href='index.HTML'>Home</a> --> <option>Home</option>

Then the <option> is added to the <select> element with .append().

The option's value attribute (property?) is set to the address of the page with .val(). This is found by getting the href attribute of the link. Using it as a setter instead of just a getter.

    option.val(anchor.attr("href"));

In the HTML it looks like this:

<option value="contact.HTML">Contact</option>

Finally, a listener is added to the select menu, so that when an option is picked the page changes, no Go button needed. That is done with .change() and another function that changes window.location to select.val(). The value of <select> is the value of the chosen <option>.

It was a little confusing when I was going through it using the same names and having to use those names to describe the behavior, but in a way it's good real life experience, since I might not be the one coding the HTML each time and picking class names and such. Plus it's probably hard to give meaningful names to everything while keeping the names fairly short without repeating a bit. "Select the <select>" is freaking painful to say.

The CSS is changed to add media queries, since the drop down is only used with small screens. The regular menu and the mobile menu are both present at all times, but display: none kicks in depending on the screen width. Nifty.

So that's done. I know it's something I need to be able to do. I need to brush up on CSS a little more, since I wasn't always clear on the whys of the thing. The CSS course seems like it was ages ago, and it was, because I was plodding through it during school.

I really want to get my energy back for this so I can finish this track and do another one by the fall. The resources aren't there for some reason. I think it's because I have to do it at night so much. This limited internet is really cramping my style. Before an imaginary someone says "Go to a hotspot, duh": I live in the country. There isn't a hotspot worth lugging the computer to. There are hotspots for a lot of stores, but they have them locked and don't share, or you have McDonalds and the grocery store where the speeds or so slow you can't check your email. Streaming video would be as bad as it is here when it rains.