[email protected]:~$

  • Extending An Object's API With Delegation In Kotlin

    Task: Expose extra API methods for an object. Methods: Derive a new class from the class of that object, implement the extra functionality, make a new object from that new class. This method is suitable in cases where the new class has an “is-a” relationship with the actual class. In...

  • Making Suspend Work On Lenovo Z510

    Suspend never worked with Linux on my Lenovo Z510. Recently I came across this issue while looking for a fix (I use NVIDIA Prime, not Bumbleebee). Suspend now works on my laptop by doing: sudo vim /etc/default/grub Replace GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" with GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi_osi=\"!Windows 2013\" acpi_osi=Linux" sudo update-grub Reboot.

  • Using Purecomponent To Prevent Wasted Renders In React

    The shouldComponentUpdate lifecycle event in React components provides a way to have more granular control over when a component should re-render as a result of an internal state update, or as dictated by the parent. Earlier this could be done by comparing nextProps with the current props using the now...

  • Sharing Websocket In React Components

    Often times there is a requirement to share a common websocket connection between React components. I have been using the React Context API to do that. Example for socket.io: In this case there is a top level component file App.js where the socket is initialized and then made available to...

  • Gsoc Mentor This Year

    I will be mentoring students in Google Summer of Code this year for two organizations: CloudCV - project: Origami. Chapel - project: Chapel Online IDE (fresh start). Time to take a look at things from the other side of the table. Looking forward to a fruitful summer! :D