Skip to content

Instantly share code, notes, and snippets.

View atxiii's full-sized avatar
🐱
⛎ Miow

Hossein Shourabi atxiii

🐱
⛎ Miow
View GitHub Profile
@atxiii
atxiii / vscode.md
Last active April 18, 2019 18:30
git clone include passphrase key with vs code on OpenSUSE(Tumbleweed)

git clone include passphrase key with vs code on OpenSUSE(Tumbleweed)

How to clone a git repository (include passphrase) with vscode

First download private key (from manage-ssh cpanel or etc) after download you can copy your private key to ~/.ssh folder

cp your-key ~/.ssh
@atxiii
atxiii / BMI.MD
Last active May 15, 2019 14:12
BMI CALCULATOR

BMI Calculator with Bootstrap 4 + Js

HTML + Bootstrap@v4

<section class="align-items-stretch bg-secondary "><div class="container  d-flex flex-column "><div class="row   my-4 py-4 "><div class="col-12 col-lg-6 col-xl-4">
<span class="text-primary f-bold mb-4 d-block">Calculate Your Body Mass Index</span>
<label for="height_bmi">Height(cm)</label>
<input type="number" name="height_bmi" class="d-block p-2 w-100" id="height_bmi" placeholder="height(cm)">
@atxiii
atxiii / functions.php
Created December 7, 2019 09:45
Redirect to checkout after click add to cart
<?php
// redirect to checkout after click 'add to cart' - Woocommerce
add_filter ('add_to_cart_redirect', 'redirect_to_checkout');
function redirect_to_checkout() {
global $woocommerce;
$checkout_url = $woocommerce->cart->get_checkout_url();
return $checkout_url;
}
@atxiii
atxiii / convert-seconds-to-hh-mm-ss.markdown
Created January 15, 2020 01:12
Convert seconds to HH:MM:SS
@atxiii
atxiii / fa-aparat.markdown
Last active November 24, 2021 11:18
fa-aparat
@atxiii
atxiii / font-awesome-4-7-for-select-html.markdown
Last active March 5, 2022 20:43
font awesome 4.7 for select html
@atxiii
atxiii / hammy-menu-svg-animation.markdown
Created May 9, 2020 06:25
Hammy menu / svg / animation
@atxiii
atxiii / Add_ACF_Content_to_WooCommerce_Description_Tab_on_Single_Products.php
Last active May 11, 2020 21:15
Add ACF content to WooCommerce Description Tab on Single Products
// Add content of Advance custom fields to description tab.
function add_acf_description_tab_content($data) {
woocommerce_product_description_tab();
echo '<hr>';
echo '<h3>Board Attributes</h3>';
$ba = get_field('board_attributes'); // ba = board_attribute => get field board_attribute from acf
$ba_items = [
// ['Attribute','value','image_url']
['Terrian',$ba['terrain'],$ba['terrain_thumbnail']],
@atxiii
atxiii / add_woo_product_brand_to_additional_information_product_tab.php
Last active May 14, 2020 15:25
Add WooCommerce Brands logo with description to Additional Information product tab
<?php
// This code should be added to the functions.php file of the child theme
// Add WooCommerce Brands logo with description to Additional Information product tab
add_filter( 'woocommerce_product_tabs', 'woo_rename_tabs', 98 );
function woo_rename_tabs( $tabs ) {
global $product;
$tabs['additional_information']['callback'] = 'add_brand_to_info'; // this is the function name which is included below
return $tabs;
}
@atxiii
atxiii / _stock.sql
Created November 2, 2020 10:28
Update Product Stocks Woocommerce by SQL
INSERT INTO `wp_postmeta`(meta_id,post_id,meta_key,meta_value) VALUES
(24947,3352,'_stock',2),(24947,3352,'_stock',21)
ON DUPLICATE KEY UPDATE meta_value=VALUES(meta_value)