Friday, April 1, 2016

How to Dissect an Android Application

Fun and Functional Programming in PHP with Macros

I was so excited about my previous article about PHP macros, that I thought it would be fun for us to explore the intersection of macros and functional programming.

PHP is already full of functions, with object oriented patterns emerging relatively late in its life. Still, PHP’s functions can be cumbersome, especially when combined with variable scope rules…

Assembling lego blocks

Consider the following ES6 (JavaScript) code:

let languages = [
    {"name": "JavaScript"},
    {"name": "PHP"},
    {"name": "Ruby"},
];


const prefix = "language: ";

console.log(
    languages.map(
        language => prefix + language.name
    )
);

In this example, we see languages defined as a list of programming languages. Each programming language is combined with a constant prefix and the resulting array is logged to the console.

This is about as much JavaScript as we’re going to see. If you’d like to learn more ES6, check out the documentation for BabelJS.

Compare this to similar PHP code:

$languages = [
    ["name" => "JavaScript"],
    ["name" => "PHP"],
    ["name" => "Ruby"],
];

$prefix = "language: ";

var_dump(
    array_map(function($language) use ($prefix) {
        return $prefix . $language;
    }, $languages);
);

It’s not significantly more code, but it isn’t as clear or idiomatic as the JavaScript alternative. I often miss JavaScript’s expressive, functional syntax, when I’m building PHP things. I want to try and win back some of that expressive syntax!

Continue reading %Fun and Functional Programming in PHP with Macros%


by Christopher Pitt via SitePoint

John Nichols

opl-small

Neat hover-sensitive parallax effect in this One Pager promoting 'Beach' - the new album by John Nichols. You'll also noticed the glitch effect on the main image when you hover over the links. Final shout out to the mobile adaption, smart how the main image turns into a background image behind the text.

by Rob Hope via One Page Love

This week's JavaScript news, issue 277

This week's JavaScript news
Read this e-mail on the Web
JavaScript Weekly
Issue 277 — April 1, 2016

Rest assured, this is (hopefully) an April Fool's free zone - unless we've been Fooled as well :-)

An introduction to a tool for developing UI components outside of your app in an isolated, more collaborative environment.
Arunoda Susiripala

Pure functions are essential for a variety of purposes, including functional programming, reliable concurrency, and React+Redux apps.
Eric Elliott

A JS decorators proposal is sitting at stage 1 of the ECMASCript process, but may soon advance further.
Nicolas Bevacqua

Master RESTful API's, Advanced Promises, new concepts in ES6, TypeScript other important learnings for moving to Angular 2. Attend remotely from anywhere in the world and take advantage of recorded sessions after course completion.
RANGLE.IO   Sponsored
RANGLE.IO

An ultra-simplified example of all the major pieces of a modern compiler written in annotated, easy-to-read JavaScript.
James Kyle

A look at style guides, why AngularJS projects can need one, and some existing style guides you can use.
Francesco Iovine

The recent events caused by the unpublishing of npm modules has caused some key changes in npm policy that you need to be aware of when publishing your own packages.
npm, Inc.

Five JavaScript implementations of the decorator pattern for fun, profit and improving understanding.
Nick Meldrum

Jobs

  • craigslist seeks JavaScript Developers (San Francisco, CA)CL seeks web devs with JavaScript, CSS, and HTML experience to join a small (~50), tech-driven, laid-back workplace to design and ship new features daily, and see them loved (or hated) by millions. Come help us save the world, or at least our corner of the Internet. craigslist
  • Frontend Consultant (Amsterdam, Netherlands)Hit the road with Backbase. Join our awesome frontend developers from more than 30 countries. Backbase
  • DevOps Engineer - Gaming Tribe (United Kingdom)Sky Betting and Gaming are looking for a DevOps Engineer. The role requires responsibility for the development and support of our PaaS toolset and the ability to communicate technical information to non-experts. Sky Bet

In brief

Curated by Peter Cooper and published by Cooper Press.

Stop getting JavaScript Weekly : Change email address : Read this issue on the Web

© Cooper Press Ltd. Office 30, Lincoln Way, Louth, LN11 0LS, UK


by via JavaScript Weekly

WP REST API: Creating, Updating, and Deleting Data

Sartre

Sartre

'Sartre' is an HTML template with an elegant One Page portfolio layout option. The One Page demo features a lovely subtle fade of the header as you scroll. The font combination is great and overall breathing room very considerate to the reading experience. Other features include smart about/bio section, AJAX loading portfolio with category filter, blog feed and contact form. Quality work this by ThemeMountain from France.

by Rob Hope via One Page Love

Værsågod

opl-small

One Page portfolio featuring a circular-shaped collage that rotates as you scroll for Norwegian digital agency, Værsågod.

by Rob Hope via One Page Love