Jackdaw's Nest

Chat and the Consumerization of IT

  • 2015-10-18

The only thing that has grown faster than Slack’s user base and valuation is its hype and mindshare among the tech press

Stratechery by Ben Thompson

Well said. It's an interesting article covering a lot of the different ways how enterprise software is being sold today.


CloudFront Supports gzip

  • 2015-12-20

Amazon CloudFront can now compress your objects at the edge. You can now configure CloudFront to automatically apply GZIP compression when browsers and other clients request a compressed object with text and other compressible file formats.

Amazon AWS

This is great news, it's about time. Hopefully HTTP/2 comes next, right Amazon?


Symfony 3.0.0 released

  • 2015-12-01

Wow, Symfony 3.0 has been released.

I have to say I'm a big fan of the Symfony release process. It's very professional and perfect for projects that need years of support.

I realise that talking about Symfony 3 makes people nervous and this post is going to explain the Symfony 3 strategy and the reasons why you should not panic.

Fabien Potencier / Symfony Blog

So, don't panic. Actually, 3.0 is not really that big a leap forward. It's nothing compared to the leap from Symfony 1 to Symfony 2. Just look at the upgrade guide. Of course, there are changes that you need to make, but most of the changes are in methods that have already been deprecated in previous versions.

I haven't tried updating yet but I will try it soon.


Playing Around With Symfony Service Container

  • 2015-11-30

Lately, I've been playing around with the Symfony Service Container. For some reason, I've never really liked it that much and I've prefered Pimple that comes with Silex framework. Defining services in YML files instead of plain PHP always felt odd.

But I think I've changed my mind now. I've just created a largish project in Symfony and now I quite like the Symfony way of defining the services. It gives you a nice distinction between configuration and your business logic. Defining the services in YML is just the configuration part, and PHP is only used for real code. That's actually pretty nice and feels good after you get used to it.


Note to Self: Check out Aurelia

  • 2015-11-16

There's a hot new name in the JavaScript world: Aurelia. This one goes straight to the top of my tools-to-check-out list.

It's still in pre-beta, but it looks interesting. Documentation is good (especially for a pre-beta) and it seems to focus on real world use cases like routing instead of trying to be the fastest framework or rendering engine compared to others.

From a first glance one of the coolest things in Aurelia is the fact that it relies heavily on plain JavaScript classes and ES2016. So most of the code you write is just plain JavaScript and not tightly coupled to Aurelia. I've been wanting to try out some of the new features of ES2015 and ES2016 and now I've got a great chance to try out ES2016 and a new framework.

ps. If you're confused with all the ES5, ES6 and ES-whatnot names, here's a good explanation by Ben McCormick.


Fixing IE Compatibility View Errors

  • 2015-11-05

I mostly hate Internet Explorer. Well, hate is a strong word, but I strongly dislike it. Sometimes it just makes the life of a web developer much more difficult.

What's Wrong?

One of the issues I've had lately concerns Compatibility view. Consider yourself lucky if you've never heard of it. In the old days (<IE9) Internet Explorer was notoriously bad in supporting web standards. Due to its market share in the corporate world a lot of company sites and intranets were designed specifically for IE.

Microsoft has cleaned up its act and things are much brighter since IE10. Except for those using the old web sites designed for older IE versions. This is where compatibility view comes in. It makes the new browsers render web pages as if they are old browsers. If you only develop modern, standards compliant web sites, you can call this brake the whole site feature. And it's built right in the browser and available in the address bar.

IE Address Bar with Compatibility Mode

Yes, it's right there in the address bar and it's pretty easy to accidentally click it.

I run into this issues every now and then. At work we still need to support IE8, although it's rarely used these days. IE9 is still quite common among some of our corporate clients.

The biggest problem is, that some companies have applied company wide policies to enforce Compatibility mode on all sites. And, of course, the end users are not allowed to change the settings themselves.

How to Fix This?

Here's how to solve this problem. Just add this meta tag to the head of the page.

It's kind of an ugly hack to an ugly hack that fixes a problem that should never have existed. But I think it's the easiest way to solve this problem. And the good thing is, that with this tag in place the Compatibility mode switch is completely hidden from the browser address bar.


Obfuscating Id's

  • 2015-10-29

What?

If you're using plain integer id's for your records, obfuscating the id's from the general public might be a good idea. You can use UUID's but that's not always possible, for instance, if you're working on a legacy project and don't want to fiddle with the database (yet).

Obfuscating id's can get handy. Basically, what it means is you can turn id's into random strings and back. For instance, you can turn 243242 to cds7rk23 and turn cds7rk23 back to 243242. There are libraries that handle this, like Tiny for php by Zack Kitzmiller.

Why?

Why would you want to do this? Well, if you have URL's like http://myapp.com/api/user/1245 it's pretty easy to guess that there probably are users with id's 1-1245. And if this is a public API, it's even more improtant. If you can guess all the data endpoints it's possible that someone is able to pull out all the data through your API. That could be your goal but in many cases it's probably not.

If you use obfuscating the url could look something like http://myapp.com/api/user/7Hc6dl3 which is a lot more difficult to guess. And it makes it close to impossible to try to guess all the other id's available.


File Upload in Silex

  • 2015-10-28

For some reason I never remember how to save an uploaded file (or the contents of the file, to be specific) in Silex, my favourite Symfony2 based framework. Well, here it is. I hope I'll remember it if I write it down.

// Get the /Symfony\Component\HttpFoundation\File\UploadedFile // 'file' is the name of the upload file field in the form. $file = $request->files->get('file')

// Get the contents of the file. $file->getRealPath() returns // the full path to the temporarily saved file. $content = file_get_contents($file->getRealPath())

There is a move method in /Symfony\Component\HttpFoundation\File\UploadedFile but I rarely use it. I usually use Flysystem to abstract the filesystem away.


Wikipedia Moving to HHVM

  • 2015-10-28

Wikimedia Foundation is happy to report that editing Wikipedia is now twice as quick

Wikimedia Blog

Wow, Wikipedia is moving to HHVM with some good performance improvements. In addition, they have listed other advantages:

  • HHVM offers sophisticated observability tools, which make it easier to spot bottlenecks and identify opportunities for eliminating unnecessary work.
  • HHVM offers static program analysis

This is big for both HHVM and Wikipedia and opens up new possibilities to "dissolve the invisible distinction between passive and active Wikipedia users".


ReactJS For Stupid People

  • 2015-10-28

React is often mentioned in the same breath as other Javascript frameworks, but "React vs Angular" doesn't make sense because they aren't directly comparable things. Angular is a complete framework (including a view layer), React is not. This is why React is so confusing to understand, it's emerging in an ecosystem of complete frameworks, but it's just the view.

Andrew Ray's Blog

React.js is just the view layer, that's it in a nutshell. Read the full post for some good insights.


Angular VS Ember VS React

  • 2015-10-28

The battle of the JS frameworks, this is something that I've been wondering lately. I'm working on a longer blog post about this, but I think in the end it comes down to these things:

  1. Use the tools you and/or your team knows
  2. Use the tools best for the job

I know that's easier said than done.


Friday Afternoon

  • 2015-10-28

Pretty productive week, I learned a lot about

  • Silex
  • Symfony Security Component
  • Twig templates
  • Guzzle
  • ADFS
  • Not bad at all.

CSS & JS Minification

  • 2015-10-28

I just installed some tools for CSS and Javascript minification and concatenating. This time I wanted something simple and lightweight and I didn't use Gulp like I usually do.

I installed Sass gem and UglifyJS and use them from the command line. This is a pretty simple and easy to get started approach for a small project.


End of the Week Reflections

  • 2015-10-28

Not the most productive week, but pretty good I guess. Considering, that there's a four-week-old little girl in the house. Next week will be even better, already looking forward to my trip to Turku on Monday.