First Steps with Erlang (Update)

Posted November 2nd, 2018

Shortly after publishing my last post about Erlang, I noticed a bug in the code which would not have happened if I wrote unit test(s) first. I did not do that simply because I just started learning, and didn’t want too many barriers up front to getting started (its hard to write tests when you are learning new syntax and methodology).

Yet when I saw the bug, I couldn’t let that slide, as here again is another reinforcement of having tests. So I opened the project back up, pretended I have no awareness of the bug, and went from there.

Tags

First Steps with Erlang

Posted October 31st, 2018

I have done a lot of research this year on what I believe will be some of the next great generation of tools and languages. I strongly believe PHP is on a fantastic road with 7.x, but there is another language that has been on my radar for quite some time, Elixir. Elixir is based on Erlang and has been deployed in many production level apps, some of them you have probably heard of.

Before I jump into that, I first wanted to learn a bit about Erlang for foundational knowledge.

Routing Client Requests from Javascript to Drupal 8 to Remote Services

Posted August 18th, 2018

On a recent project that was built on Drupal 8, we had a requirement to integrate with three different search platforms.

One of them was private access only, requiring a whitelisted IP to talk to it. On the front end, we designed and built the search form and result list logic as a ReactJS component. The component did it all, making the request and listing the results back from the response.

Make Seemingly Difficult Tasks Trivial

Posted October 31st, 2017

Earlier today there was a ping in Slack for assistance. A coworker needed to update 140 XML files with a new element, and the element value will be populated from an existing element in the node.

For most people, they hear the number “140” and think wow, this will take a while. But the number of documents here isn’t the issue, we just need to solve the problem once and apply it everywhere.

My mind quickly jumped to a shell script and some sort of sed magic. Before I opened up Vim, I jotted down what path I needed:

Tags

Command Line Fuzzy Finder Plugin

Posted October 22nd, 2017

Just wanted to drop a quick post about a plugin I came across last week called fzf.

fzf is a plugin for the command line that enables fuzzy find searching for a majority of file types in the current working directory. It also has a split pane view for file preview right in terminal, as well as a vim integration.

If you have homebrew, you can install it quickly:

Tags

Mass Updating Drupal Fields with MySql Stored Procedure Pt. 2

Posted July 13th, 2017

Ever get to the end of a project and have a panic moment when you realize that all the content entered contains links in the WYSIWYG that contain the full domain, and not just the relative path to content (ex. http://dev.mysite.com)?

Who will update this? What do we do? Before we busted out the cots, beer, and pizza, I spent an hour thinking about how we could do this.

Tags

Type Hints and Return Types in PHP

Posted July 4th, 2017

Just wanted to drop a quick nod to a long awaited feature in PHP that other languages have enjoyed for a while now… type hints and return types.

On a current project, I had to implement my own user authentication service in Drupal 8. While writing my class, I added new methods that I needed to facilitate the feature scope of the authentication workflow.

Tags

Adding Parameters to Dependency Injected Objects

Posted June 29th, 2017

In the last post, I touched on how you can define a service in your mymodule.services.yml file and pass it parameters to configure the object when it is injected as a dependency into other classes.

Following on that, I ran into a scenario where I needed to define multiple Solr cores on the servers that house the dev/qa sites, and one for staging and production. Each one would also be defined in Search API as a server, and each of the sites I am indexing would have their own index under each core per environment.

Why?