Skip to content

Instantly share code, notes, and snippets.

View yollka's full-sized avatar

Evgenii Druzhinin yollka

View GitHub Profile
@yollka
yollka / promises.md
Created January 9, 2019 14:52 — forked from domenic/promises.md
You're Missing the Point of Promises

This article has been given a more permanent home on my blog. Also, since it was first written, the development of the Promises/A+ specification has made the original emphasis on Promises/A seem somewhat outdated.

You're Missing the Point of Promises

Promises are a software abstraction that makes working with asynchronous operations much more pleasant. In the most basic definition, your code will move from continuation-passing style:

getTweetsFor("domenic", function (err, results) {
 // the rest of your code goes here.
{"results":[{"address":{"address":"\u041c\u043e\u0441\u043a\u0432\u0430, \u0410\u0441\u0442\u0440\u0430\u0434\u0430\u043c\u0441\u043a\u0430\u044f \u0443\u043b\u0438\u0446\u0430, 9\u043a2","lat":55.813081,"long":37.563305},"error":"chain_zone_changed"},{"address":{"address":"\u041c\u043e\u0441\u043a\u0432\u0430, \u041c\u043e\u0445\u043e\u0432\u0430\u044f \u0443\u043b\u0438\u0446\u0430, 13\u04411","lat":55.756439,"long":37.61325},"error":"chain_zone_changed"}]}
@yollka
yollka / WSSoapClient.php
Created July 27, 2016 14:06 — forked from Turin86/WSSoapClient.php
WS-Security for PHP SoapClient
<?php
/**
* This class can add WSSecurity authentication support to SOAP clients
* implemented with the PHP 5 SOAP extension.
*
* It extends the PHP 5 SOAP client support to add the necessary XML tags to
* the SOAP client requests in order to authenticate on behalf of a given
* user with a given password.
*