Skip to content

Instantly share code, notes, and snippets.

View pravashkarki's full-sized avatar
🏠
Working from home

Pravash Karki pravashkarki

🏠
Working from home
View GitHub Profile
@pravashkarki
pravashkarki / mac_mysql_mamp
Last active December 23, 2022 10:22
connect mysql mamp from terminal, export db, import db
Connect via Terminal (Run the code below)
/applications/MAMP/library/bin/mysql -uroot -proot
Exporting a MySQL database
mysqldump -uUSERNAME -p DATABASE > backup.sql
Importing a MySQL database
mysql -uUSERNAME -p DATABASE < backup.sql
@pravashkarki
pravashkarki / wp_query_change_url
Created December 17, 2022 11:21
WordPress Query to Change Database URL
UPDATE wp_options SET option_value = replace(option_value, 'http://www.oldsite.com', 'http://www.newsite.com') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = replace(guid, 'http://www.oldsite.com','http://www.newsite.com');
UPDATE wp_posts SET post_content = replace(post_content, 'http://www.oldsite.com', 'http://www.newsite.com');
@pravashkarki
pravashkarki / CSS Universal Selector
Last active December 11, 2022 07:27
The CSS universal selector is a selector that matches any element on the page. It is represented by the * symbol, and it can be used to apply styles to all elements on the page. The universal selector can be useful in some cases, but it is generally considered better practice to use more specific selectors to apply styles. This is because the un…
* {
font-family: Arial;
}
@pravashkarki
pravashkarki / Rstudio Knit from Console
Last active May 26, 2022 05:16
HTML Document output from Rstudio Console
rmarkdown::render("your_file_name.Rmd", "html_document")