Notes For the Future: Background Images in iOS Safari

I spent about an hour tonight trying to get my new background image to display in the Xcode device simulator. I thought it might be an image size issue, but it apparently has something to do with how the background is attached. Here’s the code I used for my header on mobile breakpoints:

header {
background: url(“../assets/header.svg”) no-repeat center center fixed;
background-attachment: scroll;
background-color: #4f4f4f;
background-position: center;
margin-top: -35px;
-o-background-size: contain;
-moz-background-size: contain;
-webkit-background-size: contain;
}

Advertisements
Notes For the Future: Background Images in iOS Safari

Notes For the Future: Android SDK Emulator

The Chrome Dev Tools screen size simulator mostly works. But when I open a site on my phone and it isn’t really doing what I expect I start to scratch my head. Fortunately the Android SDK provides a robust device simulator.

The trick, and the reason this is a note to myself for the future, is that “localhost” is at 10.0.2.2:PORT/ The emulator behaves exactly like my phone (for better or worse).

Notes For the Future: Android SDK Emulator

Rite Press Review

I love coffee. I love making coffee. Hand ground with a French grinder from the 40s or in my press-a-button Capresso I love fresh grounds. Kona? Yes, please. Deathwish – you know I’ll drink it. And I love the gadgets for brewing coffee even more.

I was skeptical about the AeroPress but I grew to rely on it as my daily coffee maker. The stainless filters have taken some getting used to but I won’t go back to paper. I have two French presses but I can’t use them. We have old pipes so I can’t wash grounds down the sink, and I don’t want to have to scrape grounds out of a glass carafe when there are other easier options. I have a hybrid of the French and AeroPress called the American press, which has this grounds-holding module with stainless filters on either end that is pressed through the hot water. Neat!

So I was super excited when I heard about the Rite Press. It’s a French Press style unit with a removable bottom; the idea being that cleaning a French Press is the worst part of using one, and I agree. So I super-earlybird pledged my $30 for a 1/2 liter in black and waited. Broad-strokes I think the Rite Press team over extended themselves and didn’t take into account that many of the Chinese factories that KS creators use are very unreliable, especially as production numbers increase in multiples of the expected order. They also made the mistake of offering the press on garbage kickstarter Indiegogo. Currently they’re experiencing a significant delay in 1L press production due to a filter manufacturer error, then changing to a new manufacturer. 1/2 L presses will suffer the same fate eventually, I’m not sure where they are on shipping these units.

But it did arrive and I have the unit to review. First the packaging is very nice. I did not have any issues with the powder coating; several commenters did. The steel button that is intended to attach the timer to the unit had fallen off and was inside the press when I opened it. I’m not sure that’s the worst thing as the timer is on the same side as the spout and the while thing seems like a silly idea. Perhaps if they had incorporated a handle it could go on the handle side. As it is, I’m not sad about it, but commenters are. The thermometer is … weird. I checked it against my CuisinArt PerfecTemp kettle and the needle didn’t get much past the third blue segment. My digital thermometer indicated the water was at 200F so I’m not sure what temp Rite Press thinks coffee should be brewed at. I don’t plan to really use it, but this was another place where the Rite team could have made better decisions.

When I unscrewed the bottom to clean it before using I had a little difficulty with the threads. That has resolved itself and I’ve since used it dozens of times without any leaking or other issues. Others are reporting poorly machines threads that make the bottom difficult to seat.

A pleasant surprise is the rubber sleeve that surrounds the middle of the unit. I believe when I pledged these were listed as vacuum sealed. That’s probably not the case as the carafe heats up quickly, so the sleeve is a nice compromise.

All in all it meets my expectations as a brewing device. Grounds go in, water goes in (and doesn’t leak out), the filter filters out the big chunks. The bottom is easy to remove and I can dump the grounds in the compost; very little of the grounds end up washed down the drain.

But can I recommend it? Not really. At $30 it was a good deal. $45 or $50 seems reasonable (having broken more than one glass carafe, this is a long-term savings for me). $60 is a bit much (and the site says the MSRP is $100), especially considering the QC issues they’ve been having. Consider that a 1L Bodum Brazil (which I have) is about $20. Want a “classic” style French Press with the metal bands? The Chambord Press is about $40 (replacement glass is roughly another $20).  If you want a stainless/metallic carafe they’re roughly $30.

If you have a Rite Press, or have one “on the way” I’d like to hear from you.

[N.b. there are some folks who complain that the piston doesn’t compress the grounds and that a watery, coffee-grounds mess spilled on the counter. It’s not an AeroPress and the French Presses I have don’t allow me to press all the way to the bottom so I’m not sure where this idea came from. Just like with a French Press, you may need to pour off the remaining brew before cleaning. ]

Rite Press Review

I Need REST (APIs)

I’ve found a few sites over the last few months that are fast and reliable when all I need is an endpoint of any ol’ data to practice AJAX and dynamic data loading. Several sites will return fake JSON data, however, some of the sample sets can return so much data that the browser can’t handle it. The following sites allow for the four main operations, GET, POST, PATCH and DELETE (or Create, Read, Update, Delete/Destroy).

JSONPlaceHolder – this site is good if you’re trying to simulate a blog with comments. It can take a while for the response to come back but it’s been reliable.

ReqRes – All your basic CRUD operations but the data it returns is smaller. Good for user stores (and Pantone color sets).

Unfortunately those seem to be the only two that are geared toward this need. Two is a lot better than none, though.

When I worked on the Seattle Gun Violence Data Tracker we used data.seattle.gov which is part of a larger civic data project.

I found this amazing resource while searching for “sample REST API”: Public API Repo It doesn’t look like any of the APIs included will let users test all four of the core methods. But, this is the sort of site that will be useful for Python students the next time we get to the BeautifulSoup/data scraping section of class.

I Need REST (APIs)

Variables inside JavaScript Functions

“It doesn’t matter where I declare my variables, right? They just get hoisted….. right?”
~ what this developer had to be thinking right before they committed this code.
Not so fast. Let’s just do a simple test using the developer tools to see whether JavaScript hoists inside functions.

function testy(){
  if(testy===true){
    console.log("It's true! I'm testy!")
  } else { 
    console.log("I'm not testy today")
  }
  var testy = true
}

Before I go showing the answer, what do you think the console shows?

.

.

.

.

.

.

.

.

Screen Shot 2018-09-18 at 9.09.42 PM

 

So it looks like JavaScript does not hoist variable declarations inside of functions. Let’s double check that with a quick change.

function testy(){
  var testy = true
  if(testy===true){
    console.log("It's true! I'm testy!")
  } else {
    console.log("I'm not testy today")
  }
}

 

What happens this time? I won’t keep you in suspense like last time:

Screen Shot 2018-09-18 at 9.12.10 PM

 

And there you have it.

Variables inside JavaScript Functions

But Your Github….

Screen Shot 2018-09-14 at 12.10.57 PM

This is my github contribution chart as of today (github). Of the few recruiters who have looked at my account one of them said “it doesn’t look like you contribute much code”. As I’m heavily back into the job search process I thought I would take a moment to explain “gaps”.

  1. I don’t typically contribute tutorial code. I have occasionally done so. The Harvard CS50 class requires that I have github integration so I can submit assignments. Andrew Ward’s Complete React Training at Udemy requires updates to a github repo as he has us deploy to heroku. But for the most part I figure this is code that is a) not mine and b) readily available from the original tutorial.
  2. I did commit my solutions to the homework that was assigned while I was a teaching assistant at University of Washington for a Python class. These are my original solutions to the assignments which I used as a guide for helping students. I don’t consider them tutorial or code-along-project code.
  3. The large gray chunk in June and July represents tutorial-heavy study time as well as a couple weeks I took off to prepare for my significant other’s birthday (we rented a hall, it was catered and we had out-of-town guests; things needed managing).
  4. With my previous employer my team lead was in charge of squashing commits and merging with master branch. While my unmodified code was credited to my account he most often made subtle changes (and some not so subtle) before merging. As far as git is concerned those are his commits and it was a sticking point between him, our CTO and me.
  5. Most of my code experiments end up on Repl.it or Codepen. I don’t feel the need to also commit that code to version control.

So that’s it in a nutshell.  I do code daily as I’m working to master React and the ecosystem that surround that library, as well as improving my learning in Python. While I am learning a lot and improving every day, it’s not code I’m “proud” of nor does it demonstrate my capabilities, which is what I think git should be used for outside of its professional uses.

But Your Github….