If you feel that this site is running snappier, you’re probably right.

I went to 3 meetups this week: Codepen.io, WPNYC, and Web Performance NY.

At two of them people mentioned Percona. So I thought I’d check it out. Digital Ocean has a great tutorial if you’d like to check it out: How To Install a Fresh Percona Server or Replace MySQL. I got stuck for a bit, but found a solution deep in the comments of a StackOverflow answer. It turns out that when I removed MySQL to install Percona it removed the php5-mysql module.

Before installing it commando on my personal site, I tried it first in my dev box at work and got a 5x improvement in speed.

This is not a scientific experiment, I implemented two other improvements as well:

  • Switched from W3 Total Cache to WP Super Cache.
  • Expanded my Digital Ocean instance as Percona recommends 1GB RAM.

Hope this helps you’re reading experience at my digital home.

Cheers!


    “The Crystal Goblet or Printing Should be Invisible”

    This metaphor is truly stunning and puts into words the careful balance between that must be maintained between content and container. This is as true for a site’s design and the content it contains as it is for typography and the text it contains.

    “Imagine that you have before you a flagon of wine. You may choose your own favorite vintage for this imaginary demonstration, so that it be a deep shimmering crimson in colour. You have two goblets before you. One is of solid gold, wrought in the most exquisite patterns. The other is of crystal-clear glass, thin as a bubble, and as transparent. Pour and drink; and according to your choice of goblet, I shall know whether or not you are a connoisseur of wine. For if you have no feelings about wine one way or the other, you will want the sensation of drinking the stuff out of a vessel that may have cost thousands of pounds; but if you are a member of that vanishing tribe, the amateurs of fine vintages, you will choose the crystal, because everything about it is calculated to reveal rather than to hide the beautiful thing which it was meant to contain.

    “Bear with me in this long-winded and fragrant metaphor; for you will find that almost all the virtues of the perfect wine-glass have a parallel in typography. There is the long, thin stem that obviates fingerprints on the bowl. Why? Because no cloud must come between your eyes and the fiery heart of the liquid. Are not the margins on book pages similarly meant to obviate the necessity of fingering the type-page? Again: the glass is colourless or at the most only faintly tinged in the bowl, because the connoisseur judges wine partly by its colour and is impatient of anything that alters it. There are a thousand mannerisms in typography that are as impudent and arbitrary as putting port in tumblers of red or green glass! When a goblet has a base that looks too small for security, it does not matter how cleverly it is weighted; you feel nervous lest it should tip over. There are ways of setting lines of type which may work well enough, and yet keep the reader subconsciously worried by the fear of ‘doubling’ lines, reading three words as one, and so forth.”

    “The Crystal Goblet or Printing Should be Invisible”
    from Beatrice Warde, The Crystal Goblet, Sixteen Essays on Typography, Cleveland, 1956


      Learning to Walk in Space

      When a child learns to walk, they take leaps beyond what their skill and strength should allow. They look out at all the people walking around them, and see what is possible. Their muscles may not be strong enough to fully support them, to balance and stand, but they see what is possible. They pull themselves up by a table leg and stand. They may bounce on their feet a few times in anticipation of walking, and then they leap over, stumble a few steps, and fall onto a couch, or into a parent’s arms.

      These are a child’s first steps.

      When we, humanity, started our space journey our technological muscles were only beginning to be formed. Germanium was still being used in transistors, and Apollo’s computers had approximately 64Kbyte of memory and operated at 0.043MHz.

      Landing on the moon was that stumbling first step that a baby takes from the table, lunging towards a couch.

      Since then we’ve been strengthening our muscles. We now have cars that can drive themselves and more computing power than we know what to do with in our own pockets.

      We have more than reached the time when we need to let go from holding on to the safety of the coffee table. We need to let go, and take steps out into the universe.

      We dreamt of hotels on the moon and we think that we failed because they don’t exist yet.

      But those dreams were the dreams of a baby believing they’re walking because a parent is holding their hands up. Our technological muscles weren’t strong enough to support hotels on the moon.

      Our technology has matured and now is the time to build those hotels. Solving the problems that we will need to solve, to have a manned base on the moon, will reverberate through our economy. Such a project will reap dividends beyond our imagination.

      There are a lot of technological problems that will need to be solved for man to safely set up camp off our planet. How will we cheaply and efficiently get past lower orbit? What sort of life sustaining systems will we need to build to survive there? Are there building materials there? How much water can be found there?

      Cellphone cameras, solar cells, and artificial limbs each were developed by NASA to solve a problem, and each became an industry in itself, generating jobs, creating wealth, and improving our overall quality of life. The solutions we create to set up camp on the moon will do the same.

      We should do this in parallel to the missions planned to Mars. The moon is close and shouldn’t wait. What we learn there will apply further out and it should pay for itself in dividends.

      We should send man back to the moon. We should build science stations on the moon.

      We should build hotels on the moon.


        I Didn’t MVP

        I’m currently learning iOS development.

        When I start learning something new, I like to play with it. I like to take it apart into tiny pieces and then put it back together. “What happens with I put this piece back over here? Or add this one instead?” You can do that with code, and that’s a lot of fun.

        When I started to gain momentum, I decided to do a project, and use that project to learn more about the language, the process, and the iOS ecosystem. I set a deadline; I wanted to have an app ready and in the app store before the end of the February. I didn’t make that deadline.

        I think that learning a new language, for me at least, contradicts the concepts of developing a product.

        When I’m learning how to code something, I add features, why? Why not? It’s something else to play with and it doesn’t matter how clunky my code is because it’s only there for me.

        When building a product you really need to keep it as simple as possible. At least for v1. If you want to test a concept, see if it has appeal and will be useful for your target audience, you need to keep the experience simple, and the features to a minimum.

        So that’s what happened. I didn’t MVP. But I’m okay with that. I have a working prototype of a much more complex app on my phone that I can show people, it’s the conversation piece I wanted it to be and looks and works pretty rad.

        The MVP is MUCH simpler, and I’ll have it out much sooner than I could the current working model.


          Long Live the QR Code

          QR codes aren’t dead, they were just never implemented well.

          In the past two weeks WhatsApp and Snapchat both announced different implementations of QR codes. What’s different now? Why would these work, and nothing else before them?

          WhatsApp uses the code to connect a specific browser with the app so that WhatsApp Web can be loaded, similar to the WordPress plugin I wrote. Snapchat added QR codes for connecting with people reducing the friction of having to remember/type in a username.

          There’s a lot of hate and cynicism towards QR codes. What they’re complaining about, mostly, comes down to ridiculous implementation and unnecessary use of the codes. Frankly they sound like luddites with their complaining.

          I’ve been disappointed with the overall implementation. QR codes are great tools to pass a small amount of information from the physical world to your mobile device. Unfortunately they’re mostly used as a gimmick. Think of them as an alternative to a shortened URL. If you don’t want to force someone type in a long URL, that would be an ideal use for a QR code.

          But you still probably shouldn’t use a QR code for most situations today; unfortunately, you need a special app to use them. Why? I don’t know, QR code deciphering libraries are built into the native iOS camera library. What’s really wrong with QR codes today is that they’re not easy enough to use.  If the camera had a “scan” setting along side the useless auto crop tool “square” people might actually discover intelligent implementations of QR codes.

          The vast majority of implementation today are ads. When I see one out in the wild I usually won’t pull out my phone because there aren’t good apps for scanning QR codes. I usually snap a picture of the ad if I’m really interested in it, then pull up the ad later when I have an extra minute.

          A good, and relevant use of a QR code for an ad would integrate location. If you scan the code, and that takes you to an app or site that verifies your location you get 30% off. But that would only really work if that specific location was important. If you’re an ad agency, there’s a freebie for you. Use it for the grand opening of a new store and place a treasure hunt in a 6 block radius of the new location.

          There’s very little you can do with QR codes that you can’t with NFC or iBeacons. But there IS a bar of technical know-how for implementing either low frequency radio powered tool, that you don’t have with QR codes. Implementing QR codes properly is really a matter of treating them as a tool, and implementing them in a way where people might actually find them useful.

          Enter WhatsApp and Snapchat. Here’s what they did right:

          1. The functionality is built straight into the app, no need for a nonexistent well-designed QR code reader to use the new feature.
          2. It reduces friction by providing a less complicated way to do something that might otherwise be more complicated. They did not use the codes as a gimmicky extra step.

          An added benefit is that it actually DOES have the intrigue a gimmick might have due to the fact that they actually got the implementation right. Proof, all the great press they got for it.

          P.S. I’m currently working on a companion iOS app for the plugin I wrote. Stay tuned…


            Support NASA – The Plan

            Anyone who knows me and has ever been around when the topic of space has come up knows that I’m a little obsessed with space and NASA. I know I’m not the only one. So once this idea stuck in my head, it’s stuck.

            The Problem

            The NASA Administrator is authorized by 42 U.S.C. 2473(b) to accept unconditional gifts or donations of services, money and property. However they are not allowed to solicit donations. Because of that, until now, the best way to donate to NASA has been through here.

            That is inconvenient and we are sure deters many people from sending in checks or money orders.

            The Plan

            An simple organization whose sole purpose is to collect those monies and donate them to NASA. (I may have an accountant to help me set this up.)

            A simple landing page (SupportNASA.org – yes I own it now) that enables people to donate to NASA. Money will be collected via online payment form and donated to NASA on a regular basis. Of course,

            Org will be run completely off donated time and services. If money is needed that will be raised separately. Due to the simplicity of the plan I don’t think there are many administrative costs aside from money fees.

            Bonus: Volunteer designers and developers will build a new donate page monthly… Because it’s cool. (Already have the launch landing page lined up. If you’re interested in grabbing a month, let me know.)

            Questions:

            • Does anyone see any issues with this plan? (legal, practical…)

            • Will NASA be okay with this? Will they take our money?

            Why?

            If you want to build a ship, don’t drum up people to collect wood and don’t assign them tasks and work, but rather teach them to long for the endless immensity of the sea.

            – Antoine de Saint-Exupery

            In depth, in the words of Neil deGrasse Tyson. 

            Brain trust: Feedback please!


              Dear NASA

              I just emailed NASA. If anyone knows anyone who works there, please put me in touch. This HAS to happen, doesn’t need to be me…  But this HAS to happen.

              To whom it may concern,

              I am a space enthusiast and web developer. I manage a team of developers and have been building websites for over 10 years now.

              I saw the video here http://www.penny4nasa.org and was inspired, but also frustrated. It’s a beautiful campaign, but the monies do not go directly to you. I’m sure what they’re doing is important, but I know people would prefer to donate directly.

              I truly believe that most americans would happily donate $1/yr and many $1/mo just to see NASA do all it wants to do.

              I was upset to discover that the only way to donate directly is via this form: http://nodis3.gsfc.nasa.gov/displayDir.cfm?Internal_ID=N_PD_1210_001G_&page_name=main

              How are people supposed to do that? Countless dollars have gone into researching the best ways to remove all boundaries from people who want to donate/pay with their money.

              Is there no legal way to bring this into a simple online form?

              I would be happy to set up a simple page through which all the money would go directly to you. I would be happy to do this gratis, only for my love of NASA and all NASA has done and does. I believe that simple metrics on that page showing a goal and how far we are from there would be all that’s needed to inspire.

              Please let me do this for you!!!

              If you are interested in considering just let me know and I’ll mock up a design.

              Best wishes,

              Jack Reichert


                Using JSONP in WordPress Development. The Quick-and-Dirty QuickStart Guide

                What IS JSONP and why should I care?

                There’s been a lot of debate lately about whether to move your site to SLL (https) or not. It’s clear, though, that all your forms, at least the ones that handle sensitive data like logins, should go over a secure connection.

                If your whole site is SSL then you won’t have any issues with making AJAX calls; however, if you DO go hybrid then Javascript will consider all the pages that are SSL as a separate domain and will block AJAX calls to them.

                Use case: You want to secure your admin area and you add define(‘FORCE_SSL_ADMIN’, true) to your wp-config.php file. You’ll remember that to make AJAX calls in WordPress you need to call: “/wp-admin/admin-ajax.php.” But that will now be an SSL connection and violates Javascript’s “same-origin policy“.

                This is where JSONP comes into the picture. As you probably know, you CAN include scripts from other sites using a script tag, that ability is the foundation of CDNs. JSONP takes advantage of that functionality.

                Basically, instead of including a static script on your site hosted on a  CDN, you’re sending a GET request to the domain of choice, and asking it to send back a callback method including within it a JSON object with the data you want. In essence, you’re spoofing your browser to think that it’s not actually doing a cross-domain ajax call, but in practice, you are.

                There’s a great discussion on StackOverflow about JSONP for further exploration.

                How do I do it?

                Below you’ll find two files, upload them to a folder in your WordPress plugins directory and activate. Note: you should probably run this on a test site. It won’t do anything bad to your site, but it’s never a good idea to play around on your production site.

                To test it add the following to any page:

                <input name="title" type="text" /> <input name="titleSubmit" type="button" />

                The javascript looks for an input button, on ANY page of your site, with the name “titleSubmit” and does the JSONP call with the content of an input text field on that page with the name of “title”.

                The most important pieces in the example that you’ll need to get your code running are:

                In the js file:

                Clearly without any of the code it won’t work properly; however, the above settings are not typical of most of your standard AJAX calls.

                type: GET: By it’s very nature a JSONP call cannot be POST. You’re essentially embedding a script tag on your page with GET variables in the URL of the script.

                cache: false: Removing this will not break your code, but for testing it’s best if you your browser doesn’t cache the responses.

                dataType: “jsonp”: You’re telling jQuery that it’s a JSONP call. Duh.

                crossDomain: true: Perhaps with the dataType set to JSONP you’d think the that this would be enabled, that’s the whole point, but you still need to set this.

                In the PHP file:

                content-type: text/javascript: You’re setting the response type being sent, application/javascript will work as well.

                access-control-allow-origin: *: This is another security check, you need to enable any origin for JSONP to work.

                $_GET[‘callback’]: Without the callback wrapping your JSON response jQuery will not recognize this as a valid response. It is set in place as a security measure similar to NONCEs.

                Conclusion

                Once you have the right recipe, JSONP with WordPress is not all that difficult. Use it well.

                As always, questions? comments? Don’t hesitate to do so below.


                  Tech and Academia

                  I’m frustrated by the tech scene ragging on academia. Yes. The system is ripe for disruption. Specifically here in the US, where the expense of higher education is rising and has put my generation and younger into ridiculous debts.

                  However, that doesn’t mean that academia itself is bad.

                  No, it’s not for everyone. But it is invaluable.

                  I have a degree in philosophy. I did not expect to get a job in that field. I hustled through college to support myself — a tour guide, translator, I worked in sales, as a tutor, and in marketing — and I hustled afterwards until I discovered my calling as a developer and taught myself to code.

                  From my degree I gained a depth and perspective on the world that follows me wherever I go, and influences every line of code I write.

                  There are plenty of fields that require academia, even tech fields. There wouldn’t be any biology startups without it. We wouldn’t have lawyers to set up our C-Corps or doctors to treat us when we get sick.

                  Let’s not forget that without our academic institutions we won’t foster our next generation of philosophers and we won’t recognize the value of the next Whitman without knowing who he is, nor will we be able to contextualize what happens across the world in the greater story of mankind.

                  It’s easy to focus on how drastically and powerfully the entrepreneurial community has changed the world, and forget the value that more traditional paths still retain.

                  Living here in the US it’s easy to forget how easy and inexpensive it is to get a top quality advanced education in many countries in Europe. The system here may be broken, but shouldn’t be discarded.

                  It also doesn’t need to be the only way. Treehouse, Lynda, and Udemy have their place. If there are better ways to train for a profession, we need to embrace that. We don’t need to require degrees to provide jobs.

                  But let us not forget the value of knowledge for the sake of itself as well. That is a huge aspect of what makes us human.


                    Why I went to the cloud…

                    I was asked to write a blogpost about my server setup. Specifically, about “the best fixes for wrangling all of those crazy cables.” To which I responded: “Oh, I just use the cloud. Never used anything else.”

                    Why don’t I host my own physical server? Cold hard cash. For the level of scale I need, a few hundred hits a day, it would be overkill to buy my own.

                    That question got me thinking about why I do wrangle my own server, albeit in the cloud, instead of relying on hosted solutions. So here goes…

                    I’ve used many of the popular shared, and not shared, hosting solutions. But I’ve always come across the same issues. As my development skills improve, I find that I can only do less and less with what I have, when I rely on others for the environment in which I run my site.

                    Let’s say I need to increase the upload limit in your php.ini? NOPE!

                    Do I want to install git? Wait, I can just install that from the command line?! What else does my unix user have permissions to do? …or other users for that matter…

                    Wait, you aren’t running PHP 5? Ok, I get that it’s complicated to upgrade PHP for existing users because you don’t want to break their sites, but, c’mon! I’m a new user!!!

                    Through a mixture of horror and frustration I decided to look into alternatives. But, to be honest, I was afraid of running and configuring a server of my very own.

                    For my first attempt I tried SUSE linux; because that’s what was being used at the office at time. But I really couldn’t keep it running. It just kept restarting. I didn’t know enough then to be able to say even now why that happened.

                    But I persisted experimenting, and with some shameless begging, we switched to CentOS in the office. I took that opportunity to build my own development environment locally. Around the time I started feeling comfortable with playing around with server configuration I discovered DigitalOcean.

                    After playing with AWS for a bit, moving to DO felt like moving to Apple from Windows XP. I had to give up a few controls that I didn’t feel too strong about, in exchange I didn’t have to think too much about settings I don’t care about. The server just worked. No extra services were needed and I knew the cost.

                    So to answer the question of why I wrangle my own server?

                    First, I like understanding the technologies upon which I am relying. The more you understand, the better performance you can pull out of something — “full-stack development” should include the Linux/Apache (or Nginx) part of the stack.

                    Second, I you’re building an plugin or theme for distribution you need to make sure it will be compatible, and you can’t really rely on the masses to be running any advanced server setups. So don’t bother with anonymous PHP functions. But if you’re building something for yourself, you should be able to enjoy the benefits of PHP 5.5 and more.

                    I’m currently working on version 3 of my server. I just moved from CentOS with a traditional Apache, PHP setup to Ubuntu with Nginx and PHP-FPM.

                    Why?

                    Well, first of all, all the cool kids are doing it.

                    More importantly, Apache slows down under heavy load, because of the need to spawn new processes, while Nginx was designed specifically to handle high traffic sites. In addition, PHP-FPM runs along side the webserver, instead of on top — like a traditional setup with apache — which reduces the recourses available.

                    This is a great example of the first reason I stated above. I saw a relatively easy way to improve my site’s performance. Since I’m in control, I can do it.