Creating Slug With Ruby

Ruby, 2016-01-17 00:46:06 UTC
Today I am dealing with 'slug'.  Yeah, as I know slug term come from Wordpress. Slug mean that downcase character separated by dash. It's something like "i-am-slug". It usually use for URI permalink. Let say I want to convert below string into slug; @tstring = "Hi!, I am Slug" To solve this;

Aborting previous ajax request

jQuery, 2016-01-15 22:17:14 UTC
Aborting previous ajax request often occure when creating an autocomplete search box. In other case, occure when you want to cancel uploading a file to the server. I wan to show you how to do that. First, let see what is ajax do when you fire an ajax; var lol = $.ajax({     url: '/api/v

An easy way using webpack

Javascript, Utilities, Web Development, 2016-01-14 11:07:36 UTC
1. Install webpack  $ npm install webpack -g   2. Create index.html <html>     <head>         <meta charset="utf-8">     </head>     <body>         <script type="text/javascript"

How to search files based on size

Macintosh, 2016-01-14 05:36:48 UTC
1. Command + F 2. If you don't see search option, you can click cog icon and choose "show view options" 3. You can choose file size in dropdown list and fill the value thant you want to search

How to know the browser tab is active or not

Javascript, Web Development, 2016-01-13 12:04:54 UTC
Today I am dealing with case when the tab is active, music is playing and if not music is pause.  To solve this problem, I need an even listener. Here is the code; var hidden, visibilityChange; if (typeof document.hidden !== "undefined") { hidden = "hidden"; visibilityChange = "vis

Rails subdomain and namespace route

Ruby on Rails, Web Development, 2015-10-24 03:44:07 UTC
Currently, I am creating an API for one of my application. Instead of using a URL like, I choose And today, I want to share my experience with you. The first thing that needs to do is to group all the controlle

Ruby File/Folder Operations

Ruby, 2015-10-04 00:12:41 UTC
file = "/the/path/" file_name = File.basename file # => "" extname = File.extname file # => ".wow" basename = File.basename file, extn # => "file_name" path = File.dirname file # => "/the/path"