Skip to content

Instantly share code, notes, and snippets.

View theachyutkadam's full-sized avatar

Achyut Kadam theachyutkadam

  • Pune, Maharashtra, india
View GitHub Profile
\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;
@theachyutkadam
theachyutkadam / Rails 6 Feature
Created March 31, 2021 09:57
Added Rails 6 new features.
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:-
@theachyutkadam
theachyutkadam / .bashrc
Created April 19, 2020 12:43
terminal setup with zsh & vim(Dell SSD)year 2020
# ~/.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
*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.
@theachyutkadam
theachyutkadam / zsh
Created November 20, 2018 17:32
command not found
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.zshenv
echo 'eval "$(rbenv init -)"' >> ~/.zshenv
echo 'source $HOME/.zshenv' >> ~/.zshrc
exec $SHELL
@theachyutkadam
theachyutkadam / mysql @localhost error
Created October 10, 2018 19:00
MySQL doesn't start without sudo cmnd use for run sudo MySQL
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 |
@theachyutkadam
theachyutkadam / postgress info
Created October 2, 2018 10:34
all query & info about postgress is very good lang & very shortcut.
https://www.vultr.com/docs/how-to-backup-and-restore-postgresql-databases-on-ubuntu-16-04
use this link
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)
@theachyutkadam
theachyutkadam / gist:72043e3e61bda3bbd64f605e926d610f
Created May 11, 2018 14:32
shift database sqlite3 to mysql
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
@theachyutkadam
theachyutkadam / setup ruby on rails installation
Last active November 13, 2018 05:29
Ruby on rails Installation setup
********* 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