Category Archives: Programming

Choosing Ember over React

Two years ago I chose Ember over Angular as my primary framework. At the time it was a hard decision. There is a much larger community around Angular, and React was starting to pickup steam. Ember uses Convention over Configuration, which really helps our team manage larger projects.

The team over at instant2fa wrote up a great explanation on why they chose Ember over React. It’s interesting to read their take on the decision. I’m hoping this will help educate people that React is just a view layer, and Ember is so much more.

Direct Link

Server Sent Events using Laravel and Vue

Recently I was working on a new project, where I had to stream stock data and display it on a chart. My first instinct was to setup a loop using setTimeout, but I quickly realized that wouldn’t work for my exact needs. Stock prices change so frequently, often happening several times a second. Doing an ajax call every second seemed like the worst overhead baggage I could possibly program myself into. After doing a bit of research, I stumbled upon Server-Sent Events.  Continue Reading

Use PHP to Retrieve All Links on a Page

I was developing a project recently, where I had the need to get all the links on a certain page. I first turned to a JavaScript library, like Jasmine.

I really wanted to do this within my PHP code, so I ended up going with this solution:


$html = file_get_contents('http://www.example.com');

$dom = new DOMDocument();
@$dom->loadHTML($html);

// grab all the on the page
$xpath = new DOMXPath($dom);
$hrefs = $xpath->evaluate("/html/body//a");

for ($i = 0; $i < $hrefs->length; $i++) {
    $href = $hrefs->item($i);
    $url = $href->getAttribute('href');
    echo $url;
}

Test Driven API Development

DotDev has posted a great tutorial on Test Driven API Development. Even though I already develop test driven APIs, I still love reading articles like this to see how others are solving problems.

I have rolled my own Transformers in the past, and I am very excited about the Fractal package they reference in this article. I’m also excited about the API documentation generator, and I think I’m going to give that a try this weekend.

Direct Link