Asad Dhamani

Thoughts, stories, ideas, and code.

  • Home
  • About
Parsing parameters with special characters in Ruby Grape

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

  • Asad Dhamani
1 min read
Using default Rails authentication with a Grape API

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

  • Asad Dhamani
1 min read
Crawling pages with lazy loaded images

Crawling pages with lazy loaded images

Hello!

  • Asad Dhamani
1 min read
Considering different strategies for archiving web pages

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.

  • Asad Dhamani
1 min read
How to learn deep learning on the cheap

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

  • Asad Dhamani
2 min read
Why I don't blog on Medium anymore - and you shouldn't either

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,

  • Asad Dhamani
2 min read
How to use iFramely as a Node library

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

  • Asad Dhamani
2 min read
Database transactions in Ruby on Rails

Database transactions in Ruby on Rails

  • Asad Dhamani
1 min read
Why coffee shops and co-working spaces are more productive

Why coffee shops and co-working spaces are more productive

  • Asad Dhamani
1 min read
How to speed up mass imports in SQLAlchemy

How to speed up mass imports in SQLAlchemy

  • Asad Dhamani
1 min read
How to detect if a page is an article

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&

  • Asad Dhamani
2 min read
mkdir -p and file copying in Node.js

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.

  • Asad Dhamani
1 min read
How to disable console.log in JavaScript

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

  • Asad Dhamani
1 min read
Media category classifications

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.

  • Asad Dhamani
1 min read
JavaScript - how to "await" in a callback

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

  • Asad Dhamani
1 min read
Using libraries from one language in another language

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,

  • Asad Dhamani
3 min read
JavaScript - One language to rule them all!

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

  • Asad Dhamani
1 min read
Meteor framework review
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

  • Asad Dhamani
8 min read
Reduce MySQL memory usage for low-end servers

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

  • Asad Dhamani
1 min read
How to add syntax highlighting to Posthaven

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,

  • Asad Dhamani
2 min read
How to copy SSH keys to a server securely

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

  • Asad Dhamani
1 min read
Redirect requests to another site using Nginx
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,

  • Asad Dhamani
1 min read
Redirect HTTP requests to HTTPS with Nginx
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

  • Asad Dhamani
1 min read
How to rename or delete a column in SQLite?
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

  • Asad Dhamani
2 min read
File uploads with Meteor
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.

  • Asad Dhamani
3 min read
Asad Dhamani © 2019
Latest Posts Facebook Twitter Ghost