How to Delete a File in Ruby

The following tutorial describes how to delete files and directories that you no longer need in your application. Removing a single file in Ruby is simple and straightforward, with File.delete. This method Deletes the […]

Ruby – Check whether a file or directory exists

Checking whether a file exists or not, is one of the most basic file-related tasks which you will do most of the time, and thankfully Ruby’s File class provides two methods called File.file?(),File.exist?() to test […]

Create WebPage Screenshots with Node.js and PhantomJS

To create webpage screenshots we are going to use PhantomJs. PhantomJS is a headless WebKit scriptable with a JavaScript API. It has fast and native support for various web standards: DOM handling, CSS selector, JSON, […]

Laravel 5 Pagination with array

Laravel provides pagination for Eloquent results out of the box, but for custom data, we need to do the pagination manually. In this tutorial, I’ll use Laravel5 LengthAwarePaginator class to show you how you can create […]

How to iterate over an array in Ruby

Each construct provides an easy way to iterate over arrays and hash. each loop will continue until it has gone through every item in the array. We have an associative array that stores the names of fruits. We want to print […]

how to get the CI’s base url in JavaScript

I received a tutorial request from my reader that asked me how to access CI’s base URL inside the JavaScript/external JavaScript files. Editing base URL of the project after each and every deployment is very frustrating […] Protection Status