Monday, February 8, 2016

Google Fit for Android: Reading Sensor Data

Clean Code Architecture and Test Driven Development in PHP

The Clean Code Architecture was introduced by Robert C. Martin on the 8light blog. The idea was to create an architecture which is independent of any external agency. Your business logic should not be coupled to a framework, a database, or to the web itself. With the independence, you have several advantages. For example, you have the ability to defer technical decisions to a later point during development (e.g. choosing a framework and choosing a database engine/provider). You can also easily switch the implementations or compare different implementations, but the biggest advantage is that your tests will run fast.

Just think about it. Do you really have to run through a router, load a database abstract layer or some ORM magic, or execute some other code just to assert one or more results?

I started to learn and practice this architecture because of my old favorite framework Kohana. At some point, the core developer stopped maintaining the code, which also meant that my projects would not get any further updates or security fixes. This meant that I had to either move to another framework and rewrite the entire project or trust the community development version.

Clean Code Architecture

I could have chosen to go with another framework. Maybe it would have been better to go with Symfony 1 or Zend 1, but by now that framework would have also changed.

Frameworks will continue to change and evolve. With composer, it is easy to install and replace packages, but it is also easy to abandon a package (composer even has the option to mark a package as abandoned), so it is easy to make “the wrong choice”.

In this tutorial, I will show you how we can implement the Clean Code Architecture in PHP, in order to be in control of our own logic, without being dependent on external providers, but while still using them. We will create a simple guestbook application.

Continue reading %Clean Code Architecture and Test Driven Development in PHP%


by Vitalij Mik via SitePoint

Getting Started with Doorkeeper and OAuth 2.0

Bellboy thin line icon for web and mobile minimalistic flat design. Vector white icon inside the red circle

In my previous series I showed how to set up a custom OAuth 2 provider using oPRO, a Rails engine. Today we are going to solve the same problem, but this time using another, more popular tool - Doorkeeper gem, created by Applicake in 2011. Since then, the project has greatly evolved and now presents a full-fledged and convenient solution. Doorkeeper can be used with basic Rails applications as well as with Grape.

In this article I will show you how to build your own OAuth 2 provider and secure API with the help of Doorkeeper. We will do basic preparations, integrate Doorkeeper, customize it a bit, and introduce scopes. In the second part of this series we'll discuss more advanced things like customizing views, using refresh tokens, crafting a custom OmniAuth provider and securing Doorkeeper default routes.

The source code for the client and server applications can be found on GitHub.

Continue reading %Getting Started with Doorkeeper and OAuth 2.0%


by Ilya Bodrov-Krukowski via SitePoint

Work Less, Get More Done, and De-Stress. Sound Good?

Work less, get more done, and de-stress. Sound good?

What if we told you that you could get way more stuff done and be a total productivity machine…and you don't have to give up your Netflix account or bathe in unicorn tears every morning to do it? Better yet, what if we told you we've already done some of the work for you? We've persuaded the pros that have somehow mastered this whole life thing to let us in on their secrets—and for a huge discount, to boot. Get the Ultimate Productivity Hacks bundle for just $39 at SitePoint Shop.

This bundle contains seven courses designed to improve pretty much every area of your life. You'll learn how to get organized, how to create a personal map to help you reach your goals, how to manage your time better, how to reduce stress, and how to kick that procrastination habit for good…right away, not next year. Plus, learn skills that you'll use for the rest of your life, like public speaking, speed reading, and meditation.

Adult better. Get the Ultimate Productivity Hacks bundle for $39.

Continue reading %Work Less, Get More Done, and De-Stress. Sound Good?%


by SitePoint Offers via SitePoint

TrumpDonald

opl-small

Hilarious interactive Single Serving One Pager where you can blow a trumpet at Donald Trump. Jokes aside, the execution is brilliant and reacts perfectly to the angle you approach from. It seems there are 16 sprites to create the animations.

by Rob Hope via One Page Love

Barrel Recap 2015

Barrel Recap 2015

Annual report One Pager featuring a team-curated Instagram feed of their best moments at NY-based digital agency, Barrel.

by Rob Hope via One Page Love

Shoutouts

Shoutouts

'Shoutouts' is a Single Serving One Pager that collects user-submitted compliments and praises online.

by Rob Hope via One Page Love