Development

  • Easy ReactJS config management

    For config management in ReactJS project I recommend using react-global-configuration NPM module. Three short steps for using it:

    Install

    npm install react-global-configuration --save

    Create config

    Create config.js file in any place you like. I prefer storing it in the root of a project:

    import config from 'react-global-configuration';
    
    config.set({
        someApiUrl: 'http://some-service.com/api'
    });
    
    export default config;

    Use it

    Now you are ready to use the config file in any React component:

    import config from '../config';
    
    return fetch(`${config.get('someApiUrl')}/users/authenticate`, requestOptions)

  • Debug PHP like Pro: Intellij Idea + VirtualBox + XDebug

    VirtualBox + XDebug overview

    For a long time I used to use built-in PHP debugging function like var_dump, debug_backtrace, spl_object_hash etc. That tools are very useful but there is one tool combining all of them. I’m talking about XDebug PHP module. With XDebug you can stop code execution in any place you need and get all information about objects, variables and call stack in one window.

    breakpoint overview

    (more…)

  • Configuring Grunt

    grunt logo

    Configuring Grunt

    Check this post to know how to install Grunt. Grunt has main script file called Gruntfile.js. It is a nodejs module – means that you are free to use all power of nodejs there.

    The module is wrapped up with this construction:

    module.exports = function(grunt) {
        .....
        some code here
        .....
    }

    We pass grunt object inside the module for further usage.

    Let’s look closer how to use it.

    (more…)

  • Installing Grunt

    grunt logo

    About

    Grunt is a NodeJS plugin that helps you automate many development routines. Further instruction contains Windows examples but it would work for Linux and MacOS as well. The only difference – NodeJS installation process.

    (more…)

  • Verbose TestNG report with Maven Surefire

    Using TestNG console output can be very inconvenient if you have lots of test cases. The better solution is to create an HTML report containing detailed information about testing progress. You can use the Maven Surefire plugin for this. Surefire report is a part of the project maven website, so at first we need to find out what is it. (more…)

Posts navigation