Parsing parameters with special characters in Ruby Grape Recently I was building an API where I had to accept URLs as parameters in Grape routes. I URL-encoded the URL, but either my request would hit the wrong route, or it wouldn't
Using default Rails authentication with a Grape API Recently, I was working on a Chrome extension for a web app where I wanted to share the login state between the extension and the web app. Generally you'd roll with a token-based
Considering different strategies for archiving web pages I'm working on a project that has an aspect of archiving web pages for posterity. This is to fight the problem of link rot. There's already sites like archive.org and archive.today.
How to learn deep learning on the cheap Deep learning is something that needs a discrete graphics card. Running deep learning programs on a CPU is just too slow, it can take days upon days to run even the most basic
Why I don't blog on Medium anymore - and you shouldn't either I've blogged on Medium in the past, and was at one point even paying them every month for their membership. They have a large network of high quality blogs, all in one place,
How to use iFramely as a Node library iFramely is a service that can be used to extract data from web pages from meta tags, opengraph tags, twitter cards, and to generate oEmbeds when possible. I've put some examples of the
How to detect if a page is an article If you've ever used a service like Pocket or Instapaper (Safari and Firefox also provide this, both powered by the now-defunct Readability parser code), you will have used a feature called "Readability&
mkdir -p and file copying in Node.js mkdir -p, wherein you create a directory, including all its parent directories if they don't exist, is functionality that is not provided out of the box by Node, but is required fairly commonly.
How to disable console.log in JavaScript Sometimes you might want to disable console.log in JavaScript, because, say, you have a library performing excessive logging, or for any other reason. This is how you can do it: console.log
Media category classifications There's this very interesting system for classifying the category a piece of text belongs to, called IPTC Media Topics. It helps you determine what subject topic a particular document / text piece belongs to.
JavaScript - how to "await" in a callback With ES6, JavaScript has added some powerful new features, one of them being async/await. What async/await basically does is it lets you write asynchronous code that looks like synchronous code, making
Using libraries from one language in another language I was recently faced with a challenge where I was building an application in Ruby, and for one specific task that I wanted to accomplish, there were no libraries for it in Ruby,
JavaScript - One language to rule them all! If there is one programming language that you should learn that will cover the highest amount of bases for you, which one should it be? JavaScript, of course! JavaScript is still the only
web dev Meteor framework review Over the last few years, I've worked extensively with the Meteor web framework. After developing and maintaining a production Meteor application for several years, here's my take on it: The Good Get started
Reduce MySQL memory usage for low-end servers Are you trying to run some MySQL based software on a server with low memory (AWS micro, Vultr micro) and keep running out of memory? If you're running this application on a server
How to add syntax highlighting to Posthaven I recently gave Posthaven a shot for hosting my blog. While ultimately I decided to go with Ghost instead due to the lack of a few features (syntax highlighting, custom URLs, image headers,
How to copy SSH keys to a server securely I much prefer SSH key authentication to password-based authentication when working with remote servers. One, it's one less password to remember. Two, on your machine, it's automatic. Three, it's more secure. So once
web dev Redirect requests to another site using Nginx I recently moved my site from GitHub Pages to my own server. For the last couple of years, I had been hosting my domain asad.pw and www.asad.pw on GitHub pages,
web dev Redirect HTTP requests to HTTPS with Nginx I recently moved my blog away from GitHub pages to Ghost, and had to set up HTTPS redirects for the same. This is how you redirect HTTP requests to HTTPS with Nginx. You
SQL How to rename or delete a column in SQLite? I recently worked on a project involving SQLite, and while creating database migrations, I realized that SQLite does not support the complete ALTER TABLE syntax completely. Out of the box, you are able
web dev File uploads with Meteor MeteorJS is an amazing framework for developing web apps, and it is really helpful in increasing development speed. One of the few things that is not provided by Meteor OOTB is file uploads.