Skip to content

Instantly share code, notes, and snippets.

View aayushdrolia's full-sized avatar
🕸️
Spider

Aayush Drolia aayushdrolia

🕸️
Spider
View GitHub Profile
@aayushdrolia
aayushdrolia / gist:6b3e2fe078272146c05c57c687413a0a
Created February 2, 2018 06:48 — forked from maxrice/gist:7918315
Get SKU from products in an order
<?php
$order = new WC_Order( $order_id );
foreach ( $order->get_items() as $item_key => $item ) {
$product = $order->get_product_from_item( $item );
$sku = $product->get_sku();
@aayushdrolia
aayushdrolia / git_remember_password.md
Created April 17, 2018 12:25 — forked from ankurk91/git_remember_password.md
Git credential cache, why type password again and again

Git tip: Tired of entering password again and again ?

Run this command to remember your password:

git config --global credential.helper 'cache --timeout 28800'

Above command will tell git to cache your password for 8 hours.

@aayushdrolia
aayushdrolia / import-sql.md
Created July 16, 2019 05:44 — forked from ankurk91/import-sql.md
MySQL: Import database via command line

Import large database to MySql ⚡

cd /path/to/backups
mysql -u root -p --default-character-set=utf8
# Switch to database 
USE database_name;
SET names 'utf8';
SET autocommit=0 ;
SOURCE backup.sql;