Javascript arrow function WTF
I thought that JavaScript arrow functions are just a shorthand notation for regular functions. I was wrong, and I found it the hard way. Arrow function treat ‘this’ keyword differently. […]
I thought that JavaScript arrow functions are just a shorthand notation for regular functions. I was wrong, and I found it the hard way. Arrow function treat ‘this’ keyword differently. […]
Here’s the scenario: the folder named “secure” contains sensitive data and should be protected by user name and password. To redirect all HTTP requests to HTTPS and enforce basic authentication […]
If I have a REST server and do PUT on an resource, should the server return new resource state in the response, or should the response body be empty? RFC-7231 […]
In a nuthsell, SimpleXMl has two things broken: 1. Elements that represent “emtpy” tags evaluate to false. This is weird design. 2. Other elements sometimes evaluate to false due to […]
The following code does not work as expected: $xml = simplexml_load_string(“<root><a/><b>text</b></root>”); $node = $xml->xpath(“/root/a”)[0]; if ($node) process($node); // process($node) may not be called for some valid nodes Unlike most other […]
I have discovered a bug in PHP 5.4.4: a simple XPATH does not work. $xml = simplexml_load_string(“<root><a/><b>text</b></root>”); $node = $xml->xpath(“/root/b”)[0]; // $node is null $node evaluates to FALSE This is […]
Suppose I want to return a list of users in JSON or CSV format depending on a query parameter. MyService.svc/users?format=json returns JSON MyService.svc/users?format=csv returns CSV The question is: how do […]
TL;DR: XML signatures are trouble, because they are ridiculously hard to implement right. XML signatures in PHP are double trouble, because of lack of decent libraries. .NET security libraries are […]
It sounds unbelievable, but modern HTML applications seem to lack proper support for dock panels. So, I created one for Angular.js. See the code in Plunker My solution is based […]
I am trying to build a simple web application based on grids. Like, have this widget occupy 1/3 of the screen on bottom, that one one line of large bold […]