Wednesday, April 6, 2016

Containerized PHP Development Environments with Vagga

It happens to all of us once in a while.

We clone a project, and then we try to run it. However, something doesn’t work.

Broken car image

It may be our version of NGINX or Apache. It might be that npm isn’t doing something right. Maybe the project needs an extension, and we don’t have it installed, and now we have to build the extension from source because the dependency does not exist in the repositories for our distribution. No matter the reason, the more complex the setup, the higher the probability of failure.

When I first got to know Vagrant, it was like heaven: there was finally a chance to break free of the shortcomings of Windows, while not having to deal with the accessibility issues present in Linux.

I was happy. For a while. And then the limitation of having virtual machines as development environments hit me. Hard.

Imagine this scene: it’s 4:30 PM. The developer working on the Asterisk system has left the company. Something in the payment logic (written in PHP using the deprecated PHPagi project) doesn’t work, and you have to fix it, fast. You and a colleague have been urging everyone toward a service-oriented architecture, and so, to be able to bring up a development environment, you have to have the following:

  • An instance of the Asterisk machine which handles calls. It must have Asterisk and PHP 5.5.X running.
  • An instance of another Asterisk machine which actually handles the payment. Since the bank you are working with has a policy of closing all access to its APIs coming from outside the building, this is a copy of the machine above, but with different code running on it.
  • The PHP back-end API that does the heavy lifting, written in PhalconPHP.

So you tape together some puppet scripts to provision your boxes, you vagrant up three machines, and prepare to enter the zone!

If this was a movie, the scene would zoom into your host machine at this point, dramatically showing the large amounts of data traveling at light speed between different parts of your system, filling up your memory and CPU, and then coming to a grinding halt. However, since this is not a movie, suffice it to say that your development machine might be able to handle one or two boxes with 8 GB of memory on Windows, but when the third machine comes up, your development environment is going to be slow to the point that you will not be able to launch an IDE.

Of course, you are very clever and resourceful, and know how this stuff works. You’d lower your memory and CPU in your vagrantfile, but that leads to Asterisk complaining about a small memory size, and when you manually call your phone system with a softphone (equivalent to a browser in the online world) to test it, the audio breaks up and distorts. You need a lot more memory than you already have, and you don’t have access to it, and now it’s 10:30 PM.

So what happens to you?

Nothing good. You fail to fix the problem that night, have to deal with an angry boss who doesn’t have the technical background to understand what you are talking about, come back to work tomorrow, tell two of your colleagues to run one of the needed machines from the list above on their own machine, and you string these virtual machines together to get the code to run. Oh, and let’s not forget the problems you have with building all the dependencies because they weren’t documented anywhere. That’d just be too ugly.

But all problems give rise to new opportunities: enter Vagga, a way to set up your project and its dependencies (usually) with a single command, with far less resource usage.

What is Vagga?

Vagga is a container engine, like Docker, which has been created to make it easier to build development environments. Since it is a fully-userspace container engine, it loads much faster than Vagrant, takes much less memory, and allows you to do awesome things like run your application in different environments in just a few seconds, without waiting for a completely virtualized machine to boot up.

Vagga is in beta stage right now and it is likely you might face some problems, but the concept shows great promise, and that’s why we have decided to take it for a spin.

Continue reading %Containerized PHP Development Environments with Vagga%


by Parham Doustdar via SitePoint

Baptiste Briel

opl-small

Slick dark-schemed AJAX loading One Pager for creative developer, Baptiste Briel.

by Rob Hope via One Page Love

Managing Data Storage with Blockchain and BigchainDB

There’s no denying that whilst Bitcoin’s future may be hazy right now, the underlying technology it relies upon — the Blockchain — has revolutionized many industries and projects, with more to come.

Ascribe is a fascinating startup that uses Bitcoin’s Blockchain to record a limited quantity of unique references to digital artworks. Thus making them traceable, accountable and (hopefully) more valuable, due to this finite amount of ‘copies’.

Ascribe hit technological problems with this approach, and those problems were primarily due to Bitcoin’s Blockchain itself. Writing everything to it is slow, costly (currently 80c each time) and has a maximum number of daily entries and total capacity for writes. It’s also counter to typical scalable database technologies, adding nodes doesn’t improve performance and has no real query language. This makes scaling a business that relies upon the Bitcoin Blockchain a challenge.

But the Blockchain concept is a strong one and the past years have seen an increasing rise in usage and legitimacy, with even major banks announcing development of technologies inspired by the concept.

Ascribe decided to combine the best of both worlds, taking a proven NoSQL database (RethinkDB) and adding a Blockchain layer on top to add control, asset tracking and an additional level of security.

This combination of technologies is especially interesting to NoSQL database users, as traditionally, few of them support ‘transactions’ that help guarantee a database change has taken place. By writing to an underlying NoSQL database via a Blockchain layer, BigchainDB adds transactional support.

Thanks to the Blockchain layer, BigChainDB also claims to be fully decentralized. Whilst many distributed NoSQL databases claim this, there is often a pseudo master/slave setup.

Installing BigChainDB and Dependencies

There are couple of ways to install BigChainDB. First I tried the Docker images, but ran into some connection issues, finding the Python packages most reliable.

  1. Install RethinkDB, for other Mac users, there is also a Homebrew package available.
  2. Install Python 3.4+.
  3. Install BigChainDB with Pip - sudo pip install bigchaindb
  4. Start RethinkDB with rethinkdb
  5. Start BigChainDB with bigchaindb start which will also configure things for you.
  6. Open the BigChainDB (actually the RethinkDB UI) admin UI at http://SERVER_IP:58080/

Simple Example - Message Allocation and Tracking

One of BigchainDB’s prime use cases (and why Ascribe created it), is for tracking assets, so let’s make a simple example in Python.

[code language="bash"]
pip install bigchaindb
bigchaindb configure
bigchaindb show-config
[/code]

Create a new file, app.py and add the following:

[code language="python"]
from bigchaindb import Bigchain
b = Bigchain()
print(b)
[/code]

This imports the bigchaindb library, creates a new object and connects to it with the settings file just created.

Then run the Python application:

[code language="bash"]
python app.py
[/code]

Continue reading %Managing Data Storage with Blockchain and BigchainDB%


by Chris Ward via SitePoint

This Week in Mobile Web Development (#102)

Read this on the Web

Mobile Web Weekly April 6, 2016   #102
Holly Schinsky recommends
Responsive Design Breakpoints: The Ultimate Overview — An in-depth overview of Responsive Web Design and how to use breakpoints specifically to design for multiple screens.
1stwebdesigner
Brian Rinaldi recommends
UX Design for Mobile: Bottom Navigation — It’s important to place frequently-used actions at the bottom of the screen, because they are comfortably reached with one-handed or one-thumb interactions.
Nick Babich
Peter Cooper recommends
Interview with Google's Alex Russell on Progressive Webapps — Simon St Laurent talks to Alex Russell about ‘progressive webapps’ and what they mean for the Web and mobile platforms alike.
O'Reilly
This issue is sponsored by GONATIVE.IO
Try GoNative.io to convert existing web to native Android & iOS — GoNative is a better approach to hybrid app development, using your existing web application with no changes required. Tons of examples in the app stores. Automatic conversion, with native plugins for push, animations, deep links, and more.
GONATIVE.IO

Chris Brandrick recommends
Accelerated Mobile Pages (AMP): Open or Closed? — As the amount of Accelerated Mobile Pages (AMP) content continues to grow, more questions are being asked about whether or not AMP benefits the open web, and whether AMP is a closed silo.
Matthew Tift
Brian Rinaldi recommends
Code Reuse in Angular 2 Native Mobile Apps with NativeScript — Using Angular 2 with NativeScript allows you to share code between your web app and your native mobile app. Nathan Walkr shows how.
AngularJS Blog
Brian Rinaldi recommends
How Mobile (And Facebook) Ate the Media World, in 5 Charts — The Web = the mobile Web (and Facebook). You knew that, but here’s a refresher.
Peter Kafka
Brian Rinaldi recommends
10 Shortcuts for Effective Responsive Design — Learn 10 responsive design shortcuts that will speed up your design workflow and create responsive sites in no time.
Studio by UXPin
Chris Brandrick recommends
Improve User Experience With Real-Time Features — Is it time to start adding real-time features to your product? Here’s some practical ideas and applications of real-time features.
Lauren Plews
Chris Brandrick recommends
A Complete Guide to Grid — A comprehensive guide covering Grid concepts as they exist in the very latest version of the spec.
Chris House
Holly Schinsky recommends
Onsen: Navigation and Tabs in the Onsen UI React Extension — How to add navigation and tabs to your Onsen UI 2.0 apps with the new react-onsenui extension.
Onsen UI
Chris Brandrick recommends
How to Optimize Image Delivery Efficiently and Cost Effectively — Best practices for making sure that all your website’s images are delivered as fast as possible to your visitors.
Nicole Amsler
Peter Cooper recommends
React Native Tools for Visual Studio Code — A dev environment, complete with debugging, for React Native projects.
Microsoft
Holly Schinsky recommends
reactstrap: React Bootstrap 4 Components — React components for Bootstrap 4 (with no dependencies on Bootstrap JavaScript or jQuery).
Brian Rinaldi recommends
Progressive Web Apps Have Leapfrogged The Native Install Model — Progressive Web Apps offer a viable alternative to the native app model but a number of issues still remain unresolved.
Michael Mahemoff
Holly Schinsky recommends
Testing Cordova In App Purchases on iOS and Android — How to setup and test In App Purchases for your Cordova apps running on iOS and Android.
Alex Disler
Holly Schinsky recommends
Onsen: Preview of React Components for Onsen UI 2.0 — A preview of the new React Components that will ship with Onsen UI 2.0.
Onsen UI
Holly Schinsky recommends
Tips For Building Cordova Apps On Android — Tips to help automate the signing, building and installing of your Cordova apps on Android.
Alex Disler
Brian Rinaldi recommends
Building Polished Mobile Apps with Telerik UI for NativeScript — TJ VanToll walks through how to use the new mobile UI components that come with the free and open source Telerik UI for NativeScript.
Telerik Developer Network
Brian Rinaldi recommends
The Cordova Browser Platform — A look at updates to the Cordova browser platform deployment option and how to use it to test apps with plugins in the browser.
Raymond Camden
Job listing
Android Developer – Brentwood, TN (onsite, Full-time) — Would you enjoy building a life-changing native Android app that reaches millions of people? (1.3 million growing) We've been working on the API design for our Every$ app, now we need someone to bring it to life!
Ramsey Solutions, A Dave Ramsey Company - EveryDollar Team

Job listing
Stop Applying to Jobs - Let Companies Apply to You — On Hired, sign up in 10 minutes and get offers from top companies like Facebook, Uber, Stripe. Engineers get an average of 5 offers on the platform in 1 week. Try it today.
Hired.com

Curated by Brian Rinaldi and Holly Schinsky for Cooper Press.
Cooper Press is located at Office 30, Fairfield Enterprise Centre, Louth, LN11 0LS, UK
Update your email address
or stop receiving MWW here


by via Mobile Web Weekly

Master Word and Excel (and Get the Certification to Prove It)

Master Word and Excel (and get the certification to prove it)

We don’t mean to alarm you, but there’s a lot more to Microsoft than just fiddling around with font size and margins in Word until your college papers looked longer than they actually were. Make Word and Excel magic with the Microsoft Office Specialist Certification Training for $29.

This deal saves you 85% on 49 hours of Excel and Word training. You’ll master Word doc formatting, learn how to use formulas in Excel, work with tables, learn how to collaborate on documents, and everything else you need to know to ace your Word and Excel certification exams. Get a full year of access to the material via web and mobile streaming.

Don’t miss your chance to save 85% on this training. Get the Microsoft Office Specialist Certification Training for $29 at SitePoint Shop.

Continue reading %Master Word and Excel (and Get the Certification to Prove It)%


by SitePoint Offers via SitePoint

PayPal Integration Part 2: PayPal REST API

Free Coffee Break Course: CloudBerry Backup for Mac OS