I am Hack Sparrow
Captain of the Internets.

JavaScript .bind() vs .apply() and .call()

So, what's the point of .bind() when we already have .apply() and .call()? For those not familiar with .bind(), .apply(), and .call(), here is a quick summary with this object [code] var fruit = { name: 'Apple' } [/code] and this function [code] function showDetails(size, price) { console.log(this.name + ' ' + size + ': $' + price + '/kg') } [/code] on mind. All three of them are function meth ...

How to disable GitHub Pages’ default Rouge code highlighter

One of the best features of GitHub Pages (Jekyll) is its ability to converted code blocks within ``` to a pre-formatted HTML code section. For example, this is how you mark a section of JavaScript code. [code] ```js var s = 'Hi'; ``` [/code] Till recently (before Jekyll 3.x), the corresponding HTML code section used to be like the following: [code] <pre> <code class="language-js">var s = 'Hi';</code> </pre> [/code] This allowed us to use mostly a ...

React Native Android: Unable to upload some APKs

While trying to build your React Native Android app, if you get the following error: [code] :app:installDebug FAILED FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':app:installDebug'. > com.android.builder.testing.api.DeviceException: com.android.ddmlib.InstallException: Unable to upload some APKs * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. BUILD FAILED Tota ...

React Native Android: failed to find Build Tools revision 23.0.1

If you have setup the Android development environment for React Native as instructed, and were trying to run your first React Native Android app, but get the "failed to find Build Tools" error: [code] FAILURE: Build failed with an exception. * What went wrong: A problem occurred configuring project ':app'. > failed to find Build Tools revision 23.0.1 * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. BUILD FAIL ...

How to merge a specific commit in git

You were working on a certain branch of a git repository, and you committed some changes to it. Then you realize, this particular commit should also go to another branch of the repository BUT you are not ready for a complete merge. Maybe this commit was meant for the other branch? You want to merge this particular commit from the current branch to the other branch of your requirement. Merging a specific commit from one branch to ...