Integrating Facebook SDK and HybridAuth PHP library
There are a few different libraries out there for integrating your site with Facebook and other social networking sites. I recently added “Login with Facebook” for a client to their PHP site utilizing the Facebook JavaScript SDK. The documentation on Facebook’s site is pretty good (although it could use a few more examples). Beyond just the login feature, this client also wanted to be able to offer a checkbox for “Post a message to Facebook about your order”. And the way they wanted it done required a PHP library to make calls to the Facebook Graph API directly.
I chose to use the HybridAuth PHP library which is a wrapper for integrating many different social networking sites using a plugin system (Facebook, Twitter, Google, other OpenID services, etc). Likewise, the docs for HybridAuth were sufficient to get the examples up and running for me. The problem was that none of the examples or documentation fit my scenario, where I already have the login set up and working with the JavaScript SDK but want to utilize the PHP library for posting to a user’s feed.
When attempting to connect to Facebook with HybridAuth it kept attempting to log the user in again. The main problem was that …
php social-networks
Android Developer Tools via Google Chrome
Recently I was working on a website on my Android phone, and I found myself needing Chrome’s Developer Tools. However, Developer Tools are not included in the Android version of Chrome for many reasons, including lack of screen real estate.
So, I looked around, and I found a solution: using a USB cable and ADB (Android Debug Bridge), you can do debugging on an Android device with Chrome’s Developer Tools from your desktop.
To show you exactly what I mean, here’s a short video demonstrating this:
So, how does one work this magic? There are several ways, but I’ll talk about the one that I used. For this method, you need to have Google Chrome version 31 or higher installed on both your Android device and your development machine.
First, you have to enable Android debugging on your device. From android.com:
- On most devices running Android 3.2 or older, you can find the option under Settings > Applications > Development.
- On Android 4.0 and newer, it’s in Settings > Developer options.
- Note: On Android 4.2 and newer, Developer options is hidden by default. To make it available, go to Settings > About phone and tap Build number seven times. Return to the previous screen …
android browsers tools
Why Can’t I Edit this Database Table? Don’t Forget the Client!
A client of mine recently informed me of an issue he’d been having for years, where he was unable to edit a specific table in his database. He uses Access to connect to a MySQL database via ODBC, and his database has a few dozen tables, all of which are editable except this one. He reports that, when trying to edit just this one table, putting the cursor into any of the fields and attempting to change any of the data is blocked. As he put it, “It’s like the keyboard won’t respond.”
We confirmed through conversation that the issue was not a MySQL permissions problem—not that I would have expected MySQL permissions to result in such client behavior. We also confirmed that, when using a different application to connect to MySQL with Perl’s DBI, the table was editable just as the rest of the database. At this point, I didn’t have any good suspects (as neither Access nor ODBC are my strong suit) and agreed to bring up the issue with the rest of the End Point engineering team.
After sending out a description of the problem, it wasn’t long before Josh Williams responded. He had seen this sort of behavior with Access before, where the client will lock out the table if the table does not …
database mysql
OpenWest Conference Recap
A few weeks ago, the Utah Open Source Foundation put on its seventh annual conference, known as OpenWest. Spencer Christensen already wrote about his experience at the conference. Family concerns kept me from attending much of it, so as time has permitted I’ve been reviewing some of the conference videos as they’ve come out. The schedule demonstrates a promising evolution as the conference expands and improves. The early years’ schedules always struck me as a bit heavy on front-end development and a limited set of currently popular technologies, and necessarily so given the smaller base of attendees and supporters. But recent years and increasing maturity have brought a very well-rounded conference. For this conference, tickets sold out.
This year’s keynotes included Utah’s enthusiastic Lieutenant Governor speaking on technology in the state, and though this is a regional conference with attendees from all over the western United States, the issues in question cross state lines as governments turn increasingly to technology, and infrastructure ties together even the very remote and rural areas that comprise much of the West. Cox’s video, available here, describes the growth of …
community conference
Elixir — a step in a never ending journey
Every now and then a new programming language is born. In fact, since the not-so-distant introduction of early programming languages, we’ve got about 693 of them! (at least that’s what Wikipedia says).
Why can’t we settle for just one or at least just a handful? Creating a new programming language certainly isn’t the easiest task on earth. It’s one thing to have fun with syntax lexers, but completely different to provide all the tooling and libraries. In fact programming languages authors are being held hostage to their own creations. There’s always a multitude of things to do, which makes leading such a project basically a full-time job.
Why are those languages sprouting all the time then? The answer is simple: out of necessity.
Pitfalls of computer programming
Most of today’s mainstream programmers choose object-oriented programming as their paradigm of choice. It solves the problems of procedural programming… we could say: in a classy way. You can find its advocates everywhere. In fact you don’t even need to search—they will yell at you from just about every corner of the Internet.
Truth be told it’s one of the things that makes producing new software possible. Some of today’s …
elixir erlang functional-programming haskell ruby
Unable to Bcc in mail, Spree 2.0 Stable Rails 3.2.14
Hello again all. As usual, I was working on a Spree Commerce website. I recently encountered an issue when trying to bcc order confirmation emails. Others have been asking about this on Github and also on the Spree mailing list, so it was time to write about the problem and the solution that worked for me.
First, I’d like to briefly describe the use case here. As with any typical e-commerce site, a user visits the site, adds some items to their cart, and checks out. After which, an order confirmation (order summary) email is sent to the user with their order details and any extra information provided by the seller.
Spree pretty much handles all this for you automatically. What about if you as the business owner would like a copy of this e-mail? Easy enough. If you review the Spree documentation you will see simple instructions for the “Mail Method Settings” to set up in the Spree Admin Interface.
Ok, so let’s say you follow all the instructions and start placing test orders (or receiving real ones), and you’re not getting bcc’d? This is where it gets tricky, so let’s check out a few things:
-
Check the logs
Check to see if Spree/Rails is attempting to send the …
email spree
CSS Conf US 2014 — Part Two
More Thoughts on Getting Vertical, Testing and Icon Fonts
Without further ado I’ve written up another batch of my notes about three more great talks at CSS Conf US in Amelia Island, Florida last week.
Antoine Butler — Embrace the Vertical
Antoine shared his observation that vertical media queries are available to CSS developers but not often used. With the vast array of devices accessing the web today vertical media queries can be a useful tool to adapt your content effectively. Antoine walked us through a couple examples of how he applied this technique in a couple of his projects. The first was a prototype of WikiPedia. While they have gone with a separated mobile site (e.g. en.m.wikipedia.org/), he started with the HTML from the desktop site and applied some vertical media queries to make the content much more digestible. Take a look at his code to see how it works.
The second example Antoine demonstrated was for the navigation at Volkswagen. The client wanted to display an unlimited number of items in the secondary navigation. Once again Antoine applied vertical media queries to handle the varying number of navigation elements based on the device height. Check out his adaptive …
accessibility android chrome conference css html
vim-airline: A lightweight status/tabline for Vim
My standard Vim configuration makes use of around 30 different plugins and I consider vim-airline to be one of the most indispensable because of its built-in functionality and superb integration with a variety of other Vim plugins. It’s a great starting point for anyone looking to extend their Vim setup with additional plugins.
I became interested in vim-airline the first time I saw screenshots of it; the color schemes, custom glyphs[1] and indicators immediately revealed value beyond the basic status bar that a stock Vim installation provides. After installing and spending some time using vim-airline I discovered additional benefits due to its integration with other plugins such as Fugitive, Syntastic and CtrlP. vim-airline provides a common platform for integrating the display indicators of plugins from various authors into one view and presents them all with consistent a consistent style.
A quick comparison of Vim with vim-airline installed:
vs. a standard Vim installation:
reveals new indicators for the current Vim mode, git branch, open buffers, and line endings. Integrating other plugins can add additional indicators for syntax errors, trailing whitespace, and more.
Using …
vim