Syed Aslam

Thoughts, Stories, and Ideas

Dynamic Full Page Background Images in Rails

by Syed Aslam in Rails · 2 min read

Easy way to set a background from a selected number of images in Rails. You can set a background image purely through CSS thanks to the 'background-size' property in CSS3. Using the `html` element is better than `body` as it's always at least the height of the browser window. You set a fixed and centered background on it, then adjust it's size using `background-size` set to the cover keyword.

rails css helpers

Understanding Linked Lists

by Syed Aslam in Data Structures · 5 min read

Linked List is a linear collection of data elements, whose order is not given by their physical placement in memory. Instead, each element points to the next. It is a data structure consisting of a collection of nodes which together represent a sequence.


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 files

Recover MySQL root Password

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.