Minor Windows Things

As I have used the Windows OS more, there are a few bits of information and small tips I have socked away. I’ve been most of this data over and over again as I have gotten to know the Windows OS as a development platform. A few of these things I feel like I have found better solutions to, but will continue to leave here for now. I will try to come back and update this list as I continue to learn Windows. It’s worth noting for now this list is based on my use of a Surface Pro 3 running Windows 10.

Continue reading

Alright, Windows! Now what?

The first time I powered on the Surface I didn’t quite know what to expect. It has been so long since I used Windows to do anything other than open up a web browser. I was a little nervous. After all, I’m supposed to be the “computer guy” in my family, but there I was with no clue what I was doing.

After running its welcome animation the Surface guided me through the setup steps. I put in my registration information, created an account, and got to the desktop screen. I’ve used Windows enough to have a general idea of how to find things. At that point, though, if you had said to me “Ok, now go make a website” I would have looked at you and laughed.

Continue reading

Dual Platform Engineering

I gave a talk in 2013 at WordCamp Denver called Breaking Up with *AMP about using Vagrant as a development environment. The presentation was received well, but for me I was more excited about the following day. Sunday of WordCamp Denver was designated a hack day, and in short order, it was decided that the main focus of the day would be core contribution.

Many participants were struggling getting up and running with the toolset required to work with WordPress core code. So we made the decision to get everyone going by having them spin up an instance of VVV. This worked fantastically because all of the tools needed to contribute back to core were packed in the virtual environment.

It worked great for everyone in the room—except for one person. He was on Windows.

Continue reading

<g>o <use> <svg>

I recently had the opportunity to speak for to the Advanced WordPress group in Austin. Special thanks to Corey Ellis for putting it all together. Here are my slides and demo videos from the talk. We had two cameras on the room, so if I find a video of the presentation show up I’ll hook that in here as well.

The main idea: SVG is not so scary. If you know HTML and CSS, you have what you need in your toolbelt to start playing with SVG. This short light introduction focuses on using SVGs as Icons making use of the <use> element.

Continue reading

Change The Rules

Imagine that you’ve woken up and it’s pitch black.

First you are afraid to move because you don’t know where you are. You wonder how it is you got here. What could you have done to get to this room? But then you realize it doesn’t matter because you are here right now and you can’t see.

Slowly, as minutes pass, your fear starts to ebb and you start moving around. You stumble around on the floor. It feels like some kind of rough wood. Finally you find a wall, and putting your left hand on it, you move around the room.

Four walls, maybe 10 feet each. It’s just a small square.

There are no windows. One of the walls houses a cheap feeling wooden door, but it’s locked. Reaching up you feel nothing, but a jump into the air reveals a low ceiling.

As the time continues to pass, you realize you’ve got a problem. You’re trapped. The way out is locked and nothing indicates anyone is coming for you anytime soon.

What do you do?

Continue reading

My First Code Review Experience

I started attending the Portland WordPress Meetup a few years ago as a way to make connections and improve my WordPress skills. However I quickly discovered simply attending meetings wasn’t helping my coding skills much. Then we had Lance Willett come and speak on breaking themes. The talk was excellent, and afterwards I made sure to introduce myself.

Lance was very gracious and offered me his contact information and told me to send him so code and he would be happy to review it.

I was excited!

I was terrified…

Continue reading

Focus Means Saying No

My wife Ashley loves ideas. She is an idea machine! Especially when it comes to crafty things. She’s taken up needle felting, sewing, sand blasting, home organization, photography, and more. It’s fantastic, and I really enjoy watching her enthusiasm when embarking on a new project.

It’s also hard to watch sometimes. She watches YouTube videos, reads books, follows patterns and recipes, but often seems a little discouraged at the final result. Doing anything for the first time is difficult. The muscle memory and finesse required to create exactly what was imagined just isn’t there yet.

Continue reading

wp.shortcode & wp.html—WordPress Shortcodes in Javascript

Shortcodes are very handy for WordPress developers. They are flexible and powerful. They can trigger complex functionality or provide fine tuned control when creating content. The biggest problem with shortcodes is that they are too much like code.

Continue reading

wp.template for front end templating in WordPress

In the WordPress development world we are used to dealing with templates. WordPress themes for the most part are a grouping of a bunch of template files that make up the look and feed of a website. We use template tags in the form of short PHP function calls to insert data into the surrounding HTML so that many different pages, or parts of pages, can use the same markup.

While we are used to doing that in WordPress with PHP, I find moving that thought process to Javascript can be a bit of a stretch for some developers. The idea is almost the the same, a bunch of HTML with tokens in it to represent where data should go and how it should be organized.

There are various ways to go about templating in Javascript. There is a loose specification called Mustache which is implemented in many languages including Javascript. Extending that a bit is a library called Handlebars. The Underscore library has templating in it as well.

What you may not have realized, though, is that WordPress has shipped with a JS templating helper since WordPress 3.5. It is based on the Underscores templating engine, but it modifies the syntax of it to make it look and feel just a little more like the Mustache, but without dragging an entire extra library along for the ride.

Here’s a definition for the wp.template method.
Continue reading

Using wp.ajax for Async Requests in WordPress

Over the years WordPress has provided a myriad of tools to make ajax requests in WordPress a little easier. After the new media modal was introduced in WordPress 3.5, a new set of tools went in to WordPress core. The javascript object wp was extended with many things, including wp.ajax. This combined with the wp_send_json_success() and wp_send_json_error() helper functions can help make performing ajax requests with the admin-ajax.php processor very straight forward.

If you are not already familiar with the admin-ajax.php processor, it’s worth learning a little more about. It is not and should not be the only way you work with Ajax in WordPress, but it’s a very useful tool to have at your disposal and should not be overlooked.

Let’s start by defining what wp.ajax is and does. It contains two methods currently, wp.ajax.post() and wp.ajax.send(). I’m going to focus this article on wp.ajax.send() because wp.ajax.post() is really just a wrapper around the send method that ensures the request is sent as a POST request. Beyond the request type, both .send and .post work almost the same.
Continue reading

© 2024 Luke on Everything

Theme by Anders NorénUp ↑