Syed Aslam

Thoughts, Stories, and Ideas

Working with Files in Ruby

by Syed Aslam in Ruby · 10 min read

The built-in class File provides the facilities for manipulating files in Ruby. Let us explore the basic file operations, including opening, reading, writing along with querying file objects to get information about the file itself.

ruby

Recover MySQL root Password

by Syed Aslam in Mysql · 1 min read

Its easy and quite common to forget a database's password. However, this doesn't mean the end of the world. Let's see how we can recover MySQL database server password following five easy steps.

mysql

Centering a Fixed-Sized Element with CSS

by Syed Aslam in Css · 1 min read

Here is one way to center a fixed-width/fixed-height div at the center of its container. This could be adapted to centering text, images, etc. within their containers. Essentially, we do a bit of arithmetic to get the fixed-sized element centered using absolute positioning and margins. Note that the parent container must have a `position: relative` property for this to work.

css