Setting Up a Virtual Host on Ubuntu 14.04 for Local Environment

Linux, Ubuntu, 2015-06-17 00:12:07 UTC
1. Edit hosts, add this line localhost nitza-Lenovo-G405s coba 2. Create new file /etc/apache2/sites-available/coba.conf <VirtualHost *:80> ServerName coba DocumentRoot /var/www/coba ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR

Basic Authentication using BCrypt

Ruby on Rails, 2015-06-17 00:11:17 UTC
1. Include BCrypt in Gemfile gem 'bcrypt', '~> 3.1.7' 2. Model $ rails g model Member email:string password:string 3. Route get 'auth/sign_up', to: 'auth#sign_up' post 'auth/sign_up/post', to: 'auth#sign_up_post' get 'auth/sign_in', to: 'auth#sign_in' post 'auth/sign_in/post', to: 'a

How to create ajax-signup in Ruby-on-Rails and Devise

Ruby on Rails, 2015-06-17 00:10:48 UTC
This is a continuation of the previous tutorial in Ruby on Rails about signing-in a user with ajax. Now, I want to show you how to create the devise signing-up in Ruby-on-Rails in the very short tutorial. 1. In the devise-aja

How to create ajax-login in Ruby-on-Rails and Devise

Ruby on Rails, 2015-06-17 00:10:23 UTC
Before I begin with this tutorial, you must know about basic devise installation and usage. If you don't, you can go to this very simple step-by-step tutorial. Just follow these steps; 1. Main page route, controller and view config/route.rb get '/main_page', to: 'main#index' app/controllers/ma

JavaScript Reserved Words

Javascript, 2015-06-17 00:09:41 UTC
  abstract arguments boolean break byte case catch char class* const continue debugger default delete do double else enum* eval export* extends* false final finally float for function goto if implements import* in instanceof int in

Resolving a removed file conflict

GIT, 2015-06-17 00:09:07 UTC
Sometimes a file conflict happens when a collaborator has deleted the file and push it to the repository. In other time, you want to pull it into your local repository. This is what happen; $ git pull remote: Counting objects: 2, done. remote: Compressing objects: 100% (2/2), done. remote: To

Resolving a merge conflict

GIT, 2015-06-17 00:08:28 UTC
The GIT is something commonly use in the work related to software development. We often use these commands; git add, git commit, git push, git pull. The conflict happens when you pull the repository because someone has changed the same file which you have committed to your local repository. $ git

Remove sensitive data from the GIT repository

GIT, 2015-06-17 00:07:57 UTC
In case, you have committed several times and you didn't notice that you have uploaded sensitive data into the repository. Even though you create .gitignore in the server repository, it will not affect. The file still can be trace and others see your sensitive data. Here are alternatives to remove s

Single page application using jQuery

Javascript, jQuery, 2015-06-17 00:06:39 UTC
Sometimes you see the URL format like this;!/the_page. Usually, this is the Angular application. This is good technique to load the page faster than a standard technique. In this tutorial, I want to show you how to create it and this technique is just using jQuery. Let's take a

Concatenate strings in Java with StringBuilder

Java, 2015-06-17 00:05:41 UTC
My recent project is converting a PHP application into Java. I have found this code in PHP. I think this piece of code is interesting because I have found this code a lot from the application. Below code used for tricky query block in PHP; $nu_filters = preg_replace('/[^a-zA-Z0-9]+/', ' ', $filter