Skip to content

Instantly share code, notes, and snippets.

View mrabro's full-sized avatar
🌍
is Online

Mohammad Rafi Abro mrabro

🌍
is Online
View GitHub Profile
@mrabro
mrabro / theme_functions.php
Last active November 1, 2022 10:05
Woocommerce variable product, include price with attribute name in variation dropdown.
<?php
// For changing Option Name of variable product on Front end, including price with attribute name
add_filter( 'woocommerce_variation_option_name', function($option, $null, $attribute, $product){
if($product instanceof WC_Product_Variable){
$variations = $product->get_available_variations();
foreach ($variations as $key => $value) {
if(isset($value['attributes']['attribute_volume']) && isset($value['display_price']) && $value['attributes']['attribute_volume'] == $option){
$option = $value['attributes']['attribute_volume'].' - Rs.'.$value['display_price'].'/-';
}
@mrabro
mrabro / README.md
Created September 27, 2022 07:33 — forked from Thong-Tran/README.md
Set up auto build and distribute flutter app on Appcenter

Auto deploying flutter app via Appcenter

Configure project

  • Active AndroidX if it isn’t already.
  • Create and checkout to new branch (appcenter currently only listen trigger from commit code on branch)
  • Setup android:
    • Comment those lines in file android/.gitignore

gradle-wrapper.jar

@mrabro
mrabro / docker-compose.yml
Last active September 5, 2022 12:50
Localhost development wordpress docker
version: "3"
services:
mysql_db:
container_name: "wordpress_db"
environment:
MYSQL_DATABASE: wordpress_db
MYSQL_PASSWORD: wordpress_user_password
MYSQL_ROOT_PASSWORD: wordpress_password
MYSQL_USER: wordpress_user
image: "mariadb:10.6.4-focal"
@mrabro
mrabro / get_youtube_channel_ID.php
Created June 17, 2022 16:51 — forked from webarthur/get_youtube_channel_ID.php
Get youtube Channel ID by channel url
<?php
function get_youtube_channel_ID($url){
$html = file_get_contents($url);
preg_match("'<meta itemprop=\"channelId\" content=\"(.*?)\"'si", $html, $match);
if($match && $match[1]);
return $match[1];
}
@mrabro
mrabro / php_keyword_replacer.php
Created July 5, 2021 20:26
Php Function to replace the keywords from text
<?php
public function replace_shortcode( $args, $body ) {
$tags = array(
'email' => "",
'firstname' => "",
'lastname' => "",
);
$tags = array_merge( $tags, $args );
@mrabro
mrabro / form_submit.js
Created December 7, 2020 14:04
Submit form via Javascript
jQuery(document).ready(function($){
function post(path, params, method) {
method = method || "post"; // Set method to post by default if not specified.
// The rest of this code assumes you are not using a library.
// It can be made less wordy if you use one.
var form = document.createElement("form");
form.setAttribute("method", method);
form.setAttribute("action", path);