VGTech is a blog where the developers and devops of Norways most visited website share code and tricks of the trade… Read more



Are you brilliant? We're hiring. Read more

Look, look – we built something!

Carpentry

As mentioned in one of the previous blog posts, two of the guys from development @ VG went to The Gathering last week. Together with Prisjakt and Level Up they had a booth there to get in touch with the young and bright geek minds.

With them to Vikingskipet they brought our new pride, and proof of the development departments handiness; a wooden, two by two meter Level Up logo with green cold cathodes. Handcrafted by Espen H, André and Kristoffer. Below I’ll share some pictures from the process. We had a really good time and I think all three of us would do this again any time!

Oh, did I forget? We don’t usually do stuff like this, so we’re very happy with ourselves :) (more…)


JavaScript: What the hell is this!?

JS

In this post we will cover some JavaScript basics with focus on areas experienced JavaScripters take for granted; but beginners sometimes struggle with.. If you fall somewhere in between then maybe this post will teach you something new!

(more…)


The Gathering Contest

The Gathering LogoLevel Up, VG and Prisjakt join forces and have a joint booth during annual easter LAN-party The Gathering, which is located in Hamar Olympic Hall. The booth will be open from 8:00 a.m to 10:00 p.m throughout the event. Here you can get some refreshments, play games or just chill out.

Not only will we have a amazing booth – you can also participate in our awesome competition with a first price of 30 000 NOK! (more…)


Comparing your privates in PHP

PHP

While working with some code that should compare two different instances of the same class I discovered a “hidden” feature in PHP.

I was going to compare several private properties between to objects and started making a piece of code to perform the actual comparison using getters for the properties. I felt the approach sucked, and started looking into alternatives way to do this. (more…)


Visualizing the most read articles on VG

JS

Article visualizationD3. Behind this name is a pretty neat concept, called Data-Driven Documents. I took a look at the framework last year after seeing a lot of cool demos using it. It’s really flexible, and is not tied to a specific form of presentation - you can use D3 to generate an HTML table from an array of numbers, or use the same data to create an interactive SVG bar chart with smooth transitions and interaction.

After looking through different layout algorithms available in D3, I found the treemap algorithm particularly interesting. I’ve seen it used before in both profiling tools and disk usage analyzers and found them to be very efficient for visualizing the difference between numbers. An idea popped into my head: “Maybe this can be used to visualize which articles are being read the most?”. I decided to give it a try. (more…)


Xcode Plugins

iOS

If you haven’t done so already it’s time to check out some Xcode plugins. How about managing cocoapods from inside Xcode or getting a Todo-list window generated from your code comments? Clang-formatting your code, install new colorthemes or getting a minimap-view like in Sublime text? (more…)


Deploying apps in openshift

DevOps

After you’ve set up openshift with a node or two, deploying an application is as easy as it gets.

You can do lots of stuff in the broker console, but rhc is the way to go:

rhc is a rubygem installed like all others:

Show code
~$ gem install rhc

To set it up:

Show code
~$ rhc setup --server your-broker-01.example.com

(more…)


Swagger docs in ZF2 with examples – Part 2: Swagger UI

PHP

This blog post on Swagger UI is a follow-up on my recent post on Swagger annotation parsing in ZF2. If you’re not already set up with Swagger annotation parsing in you ZF2 app I recommend that you read part 1 first.

In the last post we got ZF2 set up with annotation parsing and everything, and the only thing missing was Swagger UI for the neat presentation. I skipped that previosly but today we’ll add the last piece. (more…)


OpenVPN configuration files + Ubuntu’s network manager

DevOps

OpenVPN has feature that exports client configuration files. While it is definitely possible to run OpenVPN from the command line, I prefer to have a GUI that allows me to easily connect/disconnect from VPN. Ubuntu’s network manager and the .ovpn configuration files exported from OpenVPN does not play well together, however.

There is a workaround which involves cutting and pasting parts of the configuration file into separate files and adding some references to them in the configuration. After having done this a couple of times and helped other people with the same issue, I decided I’d write a simple tool to do the job instead. (more…)


Swagger docs in ZF2 with examples – Part 1: Setup and annotations

PHP

So everyone is building APIs now – parsing and outputting JSON is not that hard. Some people even build truly RESTful APIs, or something not to far from that.

Before, when building APIs was about SOAP with XML schemas and WSDL specifications, people spent so much time building their APIs that they had the time to think. Now, building an API is so easy and fast that the documentation is often suffering. Either because not much documentation is written in the first place, or because the API is evolving and nobody takes the time to update the documentation.

Swagger is a popular project providing auto generated API docs based on a service specification. This spec is based on annotation comments in the controllers and models, giving the developer a fairly easy, and close to the code way of keeping the API docs up to date.

In this two-part article on Swagger I will try to cover what you need to get your API docs up and running with Swagger + Swagger UI in ZF2. (more…)