Drone Surfing? Yes, I Want

I keep finding more reasons why I want a drone (like this one) but still can’t get myself to pull the trigger. Looking through the comments, I don’t know if this is real or not, but I imagine this would be possible (or eventually possible). I also feel like this continues my interest in board activities – snowboarding, wakeboarding and hopefully one day boosted boarding. Hope you enjoy the video and if you happen to get one of these, let me have a ride.

Getting Dokku, WordPress and Let’s Encrypt SSL Working

WordPress

If you’re reading this, you’re probably trying to get WordPress running on Dokku. Hopefully you have already figured out how to setup/connect MySQL. Once you have that, your WordPress site should be accessible (over http). But then you’ll probably want to have your site accessible over https because Google is now ranking secure sites higher and even Google Chrome is warning if sites aren’t transmitting over SSL. So, you probably found the Let’s Encrypt plugin for Dokku and installed an SSL certificate. And this is probably where you hit and problem that led to a Google search and led you here. Your site will automatically redirect from http://whatever.com to https://whatever.com but you’ll get mixed content warning because the site is trying to load external assets over http instead of https. You probably also get stuck in a infinite redirect loop (ERR_TOO_MANY_REDIRECTS) when trying to login to the admin panel. I did a lot of researching and couldn’t find a solution but eventually found someone who had figured out what was causing this problem. The easy explanation is that WordPress didn’t realize it was being requested over SSL and therefore didn’t load its assets over SSL. To fix this, you just need to add the following to your wp-config.php file:

if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') {
    $_SERVER['HTTPS'] = 'on';
}

This basically detects if the request is going over SSL and sets the HTTPS server variable to on so that WordPress will treat the request as a secure request. This is due to the fact that we’re using nginx which was causing WordPress to think the request was a non-secure request. I hope this helps someone. Happy hacking.

Google Spreadsheet API – Invalid query parameter value for grid_id

Google Sheets

I’m working on a Node/React project and I’m using the Google Spreadsheet API and hit the following error:

Error: HTTP error 400 (Bad Request) - Invalid query parameter value for grid_id.

There was nothing obvious wrong with my call:

doc.addRow(0, newObject, function(err) {});

After a little investigation, I found out that the grid_id actually represents the id of the worksheet/tab. And I also found documentation that says the index begins at “1” instead of “0”. Not a huge problem (although, unintuitive in my opinion) and relatively quick to investigate and fix. Hope this helps someone else in the future.

Lyft Android SDK and Lyft Button

Lyft Android SDK

Just came across this announcement from the Lyft development team and was pretty impressed (although I wish it was for iOS instead of Android). I really like the idea of companies providing SDKs like this where as an app developer, I can actually leverage this SDK to provide useful functionality to my users, monetize my users and help a startup I actually respect grow their users and drive business. And the company gets to benefit by extending their reach through app developers which is a win/win. This is actually a really genius idea in my opinion. I could imagine other blank-as-a-service startups provide similar SDKs so that more app developers can help grow their user base. It’s probably just ridiculous enough to work but I was thinking of a Pokemon Go app that would identify rare pokemon and determine if you could get there via Lyft in time before it vanished. If you build it, make sure to give me some credit. Okay, not sure if I’ll actually end up using this (at least I’ll wait until there’s an iOS SDK) but if I do, I would probably build a React Native wrapper around it (or if the Lyft platform team is reading this, go ahead and just build a React Native plugin for everyone). Happy hacking.

React Storybook 2 Released

Storybook

I’ve used React Storybook but haven’t been following the development closely so I was pleasantly surprised to hear about the new release. Storybook 2 looks impressive. I appreciate the backwards compatibility and updated documentation. If you are building React apps and have a lot of components that you want to re-use, this is definitely something you’ll want to use. The documentation is great and looks like it has already been updated for v2.

React Router v2.7.0 Released

Another update from this weekend was v2.7.0 of React Router. It’s been a little quiet from the React Router camp with the last update 20 days ago. No release notes but I’ll definitely be testing this version in my current project and will post anything interesting (hopefully no bugs) that I find.

React Native v0.29.0 Released

React Native

Been a little slow to announce updates, so I’ll try to be better. V0.29.0 is a pretty big update from the React Native team. A ton of iOS and Android fixes/updates, here are some of the breaking updates:

  • Kill NavigationReducers (3a8b50a) – @hedgerwang
  • NavigationExperimental – Clean up NavigationStateUtils (67002e8) – @hedgerwang
    • Remove the logic that lets NavigationStateUtils accept empty value as input and return a new state.
    • Remove the method NavigationStateUtils.getParent, NavigationStateUtils.set.
  • NavigationExperimental – Remove prop onNavigate (fb0007d) – @hedgerwang
  • NavigationExperimental – Define the generic render prop for NavigationTransitioner to render scenes (3a62314) – @hedgerwang

Check out the full release notes here.

React Native v0.25.1 Released

It’s been a little quiet lately, so this little gem caught my attention. Looks like we have another “major” (yes, I know it’s a minor version bump but since we’re not at v1.0 yet, I consider this a major update) release from the React Native team. React Native v0.25.1 looks like a nice bump in features for both Android and iOS. Here are the general updates:

New features

  • Add support for JavaScript third-party debuggers – 4c8a9f0
  • Add key to footer wrapper in WindowedListView – 58db9f3
  • Add support for missing XHR response types – fcc89e9
  • Add a way to prefetch remote images to cache with Image.prefetch – f7bcb3e
  • Add transform-es2015-function-name to the react-native babel preset – 855c0cc
  • Add instructions to reload simulator for non-QWERTY keyboards – c417c2e
  • Add support for ontimeout and onerror handler when using XMLHttpRequest for Android and iOS –d09cd62

Bug fixes

  • Add null check before accessing the refresh control ref – eac617d
  • Fix HMR on Windows – c61100d
  • Fix up PanResponder example – 05a852a
  • Fix an issue when the title in NavigationExperimentalHeader would block touches for the left component – 86d5c52
  • Fixed images required from node_modules – d0566d8
  • Fix an edge case in hot module reloading – 41576ea
  • Fix warnings in UIExplorer example pages – 528cf68
  • Fix perf tab missing key warnings – b7a3272
  • Fix swiping in navigator too quickly causes the gesture to be lost – ca2fb70
  • Fix border radius / background propagation issues in TicTacToe example – 97f60ad
  • Fix race conditions in Portal when simultaneously closing/opening – 7354ff3
  • Fix ImageEditingManager when no external cache – fffcb9c
  • Fix RefreshControl refreshing state – 93b39b7

I hate to say that I am woefully behind in terms of updating my React Native projects. I’m somewhere in the v0.18 range. I have been doing more React web lately. As much as I enjoy doing mobile development, there is something infinitely more satisfying being able to write code and refresh a browser than having to update an emulator (even if it’s as easy as CMD+R) and don’t forget that it’s so much easier to send a link to a web-based proof of concept than getting someone to install an app on their phone. Anyways, that’s just me ranting about how much I prefer being a web dev over a mobile dev. Back to the topic at hand, go check out React Native v0.25.1 and make something awesome.

Update to React Webpack Sample

So I’m starting a new project and decided to use my React Webpack boilerplate as a starting point. The first thing I realized was that my node modules were really behind. So I did what every JS developer does and upgraded everything – and then everything broke (which is exactly what happens to everyone). Anyways, the big updates include upgrading React (didn’t make the jump to v15.0 yet) to v0.14.8, upgraded Redux to v3.3, upgraded React Router to v2.0, switched from redux-simple-router to react-router-redux and other smaller upgrades like upgrading lodash to v4.0 and upgrading babel to the latest versions. Most things worked, some of the Redux and React Router syntax had changed and required updates and server side/universal rendering broke and had to be fixed. But overall, got it to work and also started converting components to ES6 classes. So lots of improvements and even started working on my new project – more on that to come. Anyways, as we know that JS changes on a weekly basis, I’m trying to keep up, so here’s the latest and greatest.