This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\l - for show all databases | |
\c database_name- for change/select database. | |
\d - list of database tables | |
select * from customers; | |
#show customers table record. | |
SELECT first_name FROM customer; | |
#show particular table row; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Action Text:- | |
How To Implement:- | |
If you want to add action_text into User model. | |
Step:- | |
1. rails action_text:install | |
2. add “has_rich_text :text” string into user.rb | |
3. <%= form.rich_text_area :content %> | |
RealTimeUser:- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ~/.bashrc: executed by bash(1) for non-login shells. | |
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) | |
# for examples | |
# If not running interactively, don't do anything | |
case $- in | |
*i*) ;; | |
*) return;; | |
esac |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*Terminal Command* | |
shortcut with ctrl + another keys | |
ctrl + a = work like home button. | |
ctrl + e = work like end button. | |
ctrl + b = work like left arrow key. | |
ctrl + f = work like right arrow key. | |
ctrl + p = work like upper arrow key, show one by one previous entered command. | |
ctrl + n = work like down arrow key, oposites of ctrl + p. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.zshenv | |
echo 'eval "$(rbenv init -)"' >> ~/.zshenv | |
echo 'source $HOME/.zshenv' >> ~/.zshrc | |
exec $SHELL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
First, connect in sudo mysql | |
sudo mysql -u root | |
Check your accounts present in your db | |
SELECT User,Host FROM mysql.user; | |
+------------------+-----------+ | |
| User | Host | | |
+------------------+-----------+ | |
| admin | localhost | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://www.vultr.com/docs/how-to-backup-and-restore-postgresql-databases-on-ubuntu-16-04 | |
use this link |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1) Product.where(payment_type: "borrow").update_all(product_name: 0) | |
2) Product.where(payment_type: "cash").update_all(product_name: 1) | |
3) Product.all.each do |product| | |
product.update(payment_type: product.price) | |
product.update(product_name: product.item_id) | |
end | |
4) Product.where(product_name "0").update_all(payment_type: "0") | |
5) product.update(product_name: product.item_id) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
database.yml file are copy anywhere for sefty. | |
out working directory are show clean. | |
show this changes. | |
https://github.com/theachyutkadam/flour_mill/commit/b3e7dc44ee1ee623d0bd88cb931ff6730ace3c39 | |
bunlde install --path .bundle | |
rake db:crete | |
rake db:load |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
********* install curl ********* | |
if you check curl are install or not then you try this - www.google.com | |
sudo apt-get install curl | |
********* install git ********* | |
sudo apt-get install git | |
********* install rvm ********* | |
********* use 6th step use this https://github.com/rvm/ubuntu_rvm link to install RVM ********* | |
1) sudo apt-get install software-properties-common |