Everybody Staze...

Nobody leavz...

  • Home
  • About Me
    • LinkedIn
    • Lab
  • Contact
  • Links
  • Reviews
  • Sitemap
  • Weather
You are here: Home / Archives for Coding

Retrieving steps data from Fitbit API

2013/12/21 By staze

phpI recently got a FitBit One (review forthcoming), and one of the big reasons I got it was their open API. Basically, the FitBit will sync over Bluetooth 4.0 (Lower Power) when it sees it’s Dongle, or if you have an iPhone/Android phone, it can sync to that in the background. That data syncs up to the FitBit website, at which point you can pull the data back down using their API… at least, that was my hope.

After playing with things for a few days, I finally got this working, and my steps information will now dynamically update. I still am not sure how I’ll correct for issues like being out of town, etc… but I’ll figure something out.

Anyway, since no one seems to have detailed how to do this with PHP, I thought I would here. This is all assuming you’ll only be grabbing your own info.

[Read more…]

Filed Under: Coding Tagged With: fitbit, Pedometer, PHP

Fun with PHP and GD

2012/06/23 By staze

Before I created the gas log on my site, I was using Green Hybrid to log gas usage/mileage. And since that time, they’ve had a graphic that you could add to your site, or in my case, forum signature that shows your mileage.

But, since I created my own log, I stopped updating Green Hybrid, so the data was out of date. I’ve long wanted to do something like this myself, so I went about creating a basic one last week.

Mileage Image

It doesn’t look the best, but it works, and it updates based on the info in my DB. The image code is pretty simple, using the PHP GD functions, and it’s pretty quickly generated. If I ever got a LOT of traffic, I’d probably have the code write the image out to disk and regenerate it every so often, but for now, it’s generated on the fly.

[Read more…]

Filed Under: Coding Tagged With: hybrid, MPG

Return of website optimization

2011/08/28 By staze

UPDATE (10/27/2011): As of today, I’m scoring a 99/100 on PageSpeed (missing point is an erroneous error about images being unoptimized), and a 99/100 on YSlow (missing point is about Cloudflare setting cookies on static content, which isn’t a huge issue). So at this point, I can finally say “USE CLOUDFLARE”. It’s more than worth it (which, since it’s free….).


So in a fit of boredom last night, I decided to take a look at page speed increases again.

This time is a bit different as I’m not using Cloudflare and I’ve changed themes. Since moving to the new theme, and an update to W3TC, I’d been getting in the mid-80’s for both Page Speed, and YSlow. Which shouldn’t be the case with Cloudflare. Everything says it should have greatly improved my speeds, and score… so something was clearly up.

So, some testing later, and I’ve figured out what was up. First, was disabling the automatic settings in W3TC. I’m guessing this (automatic minify) would work if you weren’t using a WP_CONTENT_URL (which I guess I probably don’t need anymore with Cloudflare… but changing to not use it would take a bit of work at this point.). The point of the WP_CONTENT_URL, however, is to “parallelize” the browser download process… so Cloudflare probably doesn’t solve this issue.

Anyway, disabling it, then going into W3TC’s minify section and adding all the URLs for your CSS and JS files that are loaded on your home page. Also, I went into my thematic child theme’s style.css, and removed all the @import’s, and added those CSS files to the minify settings. Reordering the CSS and JS was then a trial and error, but got it working.

Now, page loads are damn fast. And YSlow gives me 99/100, and Page Speed gives me a 97. Cloudflare gives me the CDN points, so the only thing hurting my YSlow score is Google Analytics not having long distance expiration.

Optimization takes time, but it works. I’m not positive why Page Speed is knocking off the 6 points, but I think it’s some CSS inefficiencies. *shrugs*

Good luck, and feel free to ask if you run into any issues. Might just redirect you to somewhere else, but it’s working.

Filed Under: Coding Tagged With: Cloudflare, PageSpeed, W3TC, YSlow

« Previous Page
Next Page »

Weather

Categories / Archives

  • Apple
  • Coding
  • Electronics
  • Energy
  • Home Ownership
  • Miscellany
  • Politics
  • Prius
  • Sys Admin
  • Travel
  • Uncategorized
  • Work
  • June 2026
  • April 2026
  • August 2025
  • April 2025
  • January 2024
  • February 2021
  • July 2020
  • January 2020
  • April 2019
  • March 2018
  • February 2018
  • June 2017

Copyright © 2026 · Staze On Genesis Framework · WordPress · Log in