Categories
Book Study Recommendation Books Symfony

BOOK : mastering symfony – Take away

Categories
General SQL

mysql 8

Create new User

– Full privileges

 

 

Categories
BEST PHP CODE

Force to write debugging messages in PhpUnit

If you found yourself trying to debug PhpUnit the following php line will relieve your frustration. This line will instantly output the message or variables values that you are trying to debug

fwrite(STDERR, "TEST");
Categories
AWS AWS SQS

AWS – SQS – LAMBDA – CloudWatch – Slack – DLQ – SNS

I am currently working on a transactional platform where orders are pushed to a Queue SQS then pulled and processed by lambda.

In a problematic situation , lambda triggers AWS SNS which will notify sysOp via email and a Slack Channel. Awesome ! And more importantly a DLQ – Dead-Letter Queue will contain workers waiting to be reprocessed and sent to our Technical Customer Service Department to analyze what went wrong

Categories
General

New Relic – Monitoring System

Adding more visibility to my teams

New Relic is a web application performance service designed to work in a real time with your live web app. New Relic Infrastructure provides flexible, dynamic server monitoring. … It can be considered as the plumbing that makes web apps run faster.

Categories
BEST PHP CODE

PHP 7.4 – Null Coalescing Assignment Operator

Null Coalescing Assignment Operator

In the long run, this code could be a bit difficult to maintain. So, aiming to help developers to write more intuitive code, this RFC proposes the introduction of the null coalescing assignment operator (??=). So, instead of writing the previous code, we could write the following:

$this->request->data['comments']['user_id'] ??= ‘value’;
Categories
BEST PHP CODE

New Features php-7.4

source : https://raw.githubusercontent.com/php/php-src/php-7.4.0beta4/UPGRADING

========================================
2. New Features
========================================

- Core:
  . Added support for typed properties. For example:

        class User {
            public int $id;
            public string $name;
        }

    This will enforce that $user->id can only be assigned integers and
    $user->name can only be assigned strings. For more information see the
    RFC: https://wiki.php.net/rfc/typed_properties_v2



  . Added support for coalesce assign (??=) operator. For example:

        $array['key'] ??= computeDefault();
        // is roughly equivalent to
        if (!isset($array['key'])) {
            $array['key'] = computeDefault();
        }

    RFC: https://wiki.php.net/rfc/null_coalesce_equal_operator

  . Added support for unpacking inside arrays. For example:

        $arr1 = [3, 4];
        $arr2 = [1, 2, ...$arr1, 5];
        // $arr2 == [1, 2, 3, 4, 5]

    RFC: https://wiki.php.net/rfc/spread_operator_for_array

.php.net/rfc/tostring_exceptions
Categories
General

PHP API Architecture

 

 

david-raleche-php-api-architecture-bundle
david-raleche-php-api-architecture-bundle

PHP API – Bundle composition

  • controllers
  • services
  • models
  • repositories
  • tests (unit test)

 

Categories
AWS AWS SQS javascript

SOLUTION – POST API CALL in AWS SQS-LAMBDA – NODEJS – Javascript

If you have been struggling in amazon aws with the combo Lambda-SQS NodeJS fixing following type of errors :

read ECONNRESET at TLSWrap.onStreamRead

Error: read ECONNRESET at TLSWrap.onStreamRead

 

ERROR Uncaught Exception {“errorType”:”Error”,”errorMessage”:”getaddrinfo ENOTFOUND https://xxxx.xxxxxr.com https://xxxxx.xxxxx.com:443″,”code”:”ENOTFOUND”,”stack”:[“Error: getaddrinfo ENOTFOUND

 

ERROR Invoke Error {“errorType”:”TypeError [ERR_INVALID_ARG_TYPE]”,”errorMessage”:”The first argument must be one

Here is the solution

exports.handler = async (event) => {
     try {
         const res = await axios.post('https://davidraleche.com/v1/test',JSON.stringify({}), {
         headers: {
             'Content-Type': 'application/json'
         }})
         console.log(res)
         return {
             statusCode: 200,
             body: res.data
         }
     } catch (e) {
         console.log(e)
         return {
             statusCode: 400,
             body: JSON.stringify(e)
         }
     }
};

 

Categories
Technical

About Me

Developers spend considerable time configuring their work environment. This is an exhausting task and it is tiring. Software engineering is Joy when we can develop and think about logic and Speed performance. This is the whole purpose of this blog !

I am from France (Paris area) and I now live in Los Angeles where the scenery is gorgeous and the weather is clement and welcoming. See some beautiful pictures on the following link  instagram.com/dolosangeles

Los Angeles

have a look to business. directory of Los Angeles
losangeles.raleche.com

New York City

I have worked many years in New York City in the IT and gaming industry. At first I have worked as an IT consultant for diverse french luxury companies. I was leading projects onsite and managing a team of developers based in Philippines. It provided me great experience in managing team overseas. Afterward I worked for a well-known french real estate agency focusing on short-term rental until the arrival of the mega-monster company airBnb who took over the entire industry such as a tsunami. Thereafter, I spent many years working in the gaming industry where I developed and pioneer innovative social gaming technics with Facebook at their headquarter Menlo Park

see more pictures here https://raleche.blogspot.com/p/my-past-experience-high5games-new-york.htmlSee below the view from my ex-office the world trade center known as the freedom tower today in New York City while working for high 5 games

Professional Career

I am specialized in LAMP stack environments (Linux, Apache, MYSQL, PHP) I have more than 15 years experience with PHP. 

LinkedIn
linkedin.com/in/davidraleche/

Stackoverflow
https://stackoverflow.com/users/7782346/david-raleche

I have developed APIs, backend websites and frontend websites, I have managed teams and implemented complex automated solutions throughout my career I have experienced new programming environment in the cloud such as AWS (NodeJs, Lambda, SQS, SNS)
I am a technologist enthusiast and share my findings via different social media platforms

Packagist
packagist.org/packages/yana/dr

Blogs
https://medium.com/@davidraleche

Twitter
https://twitter.com/DavidRaleche

EDUCATION


Stevens Institute of Technology, Hoboken USA
Master of Information System – Dec 2008

Epitech Graduate School of Digital Innovation, Paris France
Master of Computer Science – Dec 2007


Hobbies


HOA President – 2016 – present
Home Owner Association

Google Analytics/Adwords Certified – 2018

Languages

English

French