Creating bash script

Written By:

MAC OS

1. Firstly, creating a file to contain the script. touch hello 2. Adding these script. #!/bin/bashecho hello work #!/bin/bash to tells the terminal that you are using bash shell 3. Making an execut...


[Rails] Importing Excel

Written By:

Ruby on Rails BACKEND EXP Rails Best Practices EXP

upload method to show a screen to allow uploading file upload_preview method to show file content to get confirm upload_submit method to save data ROUTES post 'outload/upload_preview', to:'outloa...


[EXP] How to develop UPDATE function with a UI having appending and removing function

Written By:

UI & UX UI solutions EXP UI EXP BACKEND EXP Problem Solving

UPLOAD Take a look on this article: http://guruonrails.com/multiple-upload-files In UI we will develop append and minus function like this: First loading: Adding hidden field contains document'...


[Rails] Custom Foreign Key

Written By:

Ruby on Rails BACKEND EXP Rails Best Practices EXP

Sometime we need to define a custom name for foreign key for more friendly or something else. class ContainerType < ApplicationRecord has_one :container_mode, foreign_key: 'mode', class_name: 'C...


[SERVER][VPS] Centos management

Written By:

EXP Server Centos

Download from VPS scp root@[IP]:/home/truong/workspace/[FILE] [LOCAL FOLDER] scp root@[IP]:/home/truong/workspace/[FILE] .


[UI] Recognize Browser

Written By:

UI & UX UI EXP EXP UI Tips

https://jsfiddle.net/will_nguyen/dj44k022/


[UI] Showing part of image

Written By:

UI & UX UI EXP EXP UI Tips

Imagining that a DIV will contain a Image so that we will add css attributes for this DIV to make other parts of image hidden. .div-abc{ position: relative overflow: hidden}


[UI] Select2

Written By:

UI & UX UI EXP EXP UI Tips

Custom css to change default value of .s2-no-border .select2-container--default .select2-selection--single{ border: 0px solid white;}


MVC structure of javascript - coffeescript

Written By:

JavaScript Best Practices UI EXP EXP

application.js.coffee $(document).on('turbolinks:load', () -> className = $('body').attr('data-class-name') window.applicationView = try eval("new #{className}()") catch error new Views.Applicat...


[Ruby] Ruby Basic

Written By:

Ruby

# for-loop method for n in 0..1 puts n end 0 1 => 0..1 # times method 2.times do |n| puts n end 0 1 => 2 # range method (0..1).each do |n| puts n end 0 1 => 0..1 # upto method 0.upto(1) do...


Copyright @ 2016 guruonrails