Preslav's Thoughts and Ramblings


  • 23 July 2017

    Properties in Swift: How to Avoid Shooting Yourself in the Foot

    Swift provides several constructs which make writing code a more fluid experience, with less boilerplate. Sometimes this succinctness of syntax comes at a potential cost though. One such aspect are properties, and more specifically, property initialisation. A small difference in the syntax might result in unnecessary memory consumption, unexpected state...

  • 06 May 2017

    Testing React Native Applications Part I: Jest

    When I started with React Native not long ago I was frustrated by the overwhelming amount of irrelevant information on how to test React applications. React is known to evolve fast, often introducing breaking changes, so this should not be surprising to most developers. Still, the amount of deprecated content...

  • 26 March 2017

    Debugging Network Calls in React Native Using the Chrome Debugger

    TL;DR! Just give me the code In your index.js file (or your platform-specific index file for that matter), simply add the following line to the top, directly after the import statements: XMLHttpRequest = GLOBAL.originalXMLHttpRequest ? GLOBAL.originalXMLHttpRequest : GLOBAL.XMLHttpRequest; You will also need a Chrome plugin that overrides CORS....

  • 06 March 2017

    New Mini Project: Kotlin Project Generator

    Over the weekend, I started a new mini project of sorts. I needed a generator for small Kotlin projects, which would come with a simple Gradle build file and could provide different dependencies, based on my choice. As a Java developer, one way to look at this would be to...

  • 26 February 2017

    Dealing with Python-Version Exceptions When Using node-gyp

    I was trying to install a JavaScript library called numjs (basically, a JS equivalent to numpy), when I got the following exception: # Executing the following command... $ npm install numjs --save # resulted in ... gyp ERR! UNCAUGHT EXCEPTION gyp ERR! stack Error: spawn EACCES gyp ERR! stack at exports._errnoException (util.js:...