Friday, April 1, 2016

Sketchpad – Simple Sketchpad Library with Javascript

Sketchpad is a simple sketchpad library created by usin javascript. Sketchpad API also provides some useful functionalities.


by via jQuery-Plugins.net RSS Feed

Eckstein & vier

Website for the Real Estate Development firm eckstein & vier from Austria.


by csreladm via CSSREEL | CSS Website Awards | World best websites | website design awards | CSS Gallery

Front-end & WordPress Development

We’re the collective of handpicked web specialists you need to craft the beautiful, responsive digital experiences you dream of.


by csreladm via CSSREEL | CSS Website Awards | World best websites | website design awards | CSS Gallery

Profi – Multipurpose Corporate Word

Profi WP will perfectly suit the needs of any modern agency, small and medium business, corporate or personal portfolio. Will fit great on all type of devices: desktop, tablet, mobile phone


by csreladm via CSSREEL | CSS Website Awards | World best websites | website design awards | CSS Gallery

Rockyrama

Rockyrama is a goldmine of cinema and pop culture where you can find videos and articles to infinite and beyond.


by csreladm via CSSREEL | CSS Website Awards | World best websites | website design awards | CSS Gallery

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