This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$_fp = fopen("php://stdin", "r"); | |
while($string = fgets($_fp)){ | |
$string = strtolower($string); | |
$string = str_replace(' ', '', $string); | |
$string = str_split($string); | |
$abc = range('a', 'z'); | |
$gap = array_diff($abc, $string); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
session_start(); | |
require_once __DIR__ . '/src/Facebook/autoload.php'; | |
$fb = new Facebook\Facebook([ | |
'app_id' => 'APP_ID', | |
'app_secret' => 'APP_SECRET', | |
'default_graph_version' => 'v2.5', | |
]); | |
$helper = $fb->getRedirectLoginHelper(); | |
$permissions = ['user_birthday', 'user_location', 'user_website']; // optional |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//Exit if accessed directly | |
if ( ! defined( 'ABSPATH' ) ) { | |
exit; | |
} | |
function dwwp_register_post_type() { | |
$singular = 'Job'; | |
$plural = 'Jobs'; | |
$slug = str_replace( ' ', '_', strtolower( $singular ) ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//* Do NOT include the opening php tag shown above. Copy the code shown below into functions.php | |
/** | |
* Manage WooCommerce styles and scripts. | |
*/ | |
function grd_woocommerce_script_cleaner() { | |
// Remove the generator tag | |
remove_action( 'wp_head', array( $GLOBALS['woocommerce'], 'generator' ) ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
clear | |
# Remove/Uninstall process | |
echo "WordPress Installation Starts :)" | |
if [[ $1 == "remove" ]]; then | |
| |
# Grab the project name | |
if [[ -z $2 ]]; then | |
echo "WP Project to remove: " |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action( 'woocommerce_product_query', function( $qeury ) { | |
if ( empty( $qeury->query_vars['orderby'] ) || 'popularity' !== $qeury->query_vars['orderby'] ) { | |
return; | |
} | |
add_filter( 'posts_clauses', function( $args ) { | |
$args['orderby'] = ' CASE wc_product_meta_lookup.min_price WHEN 0 THEN 1 | |
ELSE -1 | |
END ASC, wc_product_meta_lookup.total_sales DESC, wc_product_meta_lookup.product_id DESC | |
'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Path to your oh-my-zsh installation. | |
export ZSH=/Users/SumonMSelim/.oh-my-zsh | |
# Set name of the theme to load. | |
ZSH_THEME="powerlevel9k/powerlevel9k" | |
POWERLEVEL9K_MODE="awesome-fontconfig" | |
# User configuration | |
export TERM="xterm-256color" | |
export SHELL="/bin/zsh" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if ( 'invoice.payment_succeeded' == $event->type ) { | |
$user_id = $wpdb->get_var( "SELECT `user_id` FROM $wpdb->usermeta WHERE `meta_key` = '_stripe_subscription_id' AND `meta_value`='$invoice->subscription'" ); | |
$period_start = date( 'Y-m-d H:i:s', $invoice->period_start ); | |
$period_end = date( 'Y-m-d H:i:s', $invoice->period_end ); | |
$order_id = get_user_meta( $user_id, 'product_order_id', true ); | |
if ( $invoice->paid ) { | |
update_user_meta( $user_id, 'product_pack_startdate', $period_start ); | |
update_user_meta( $user_id, 'product_pack_enddate', $period_end ); | |
update_user_meta( $user_id, 'can_post_product', '1' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Update post_author id for shop_orders | |
* | |
* @since 2.9.4 | |
* | |
* @return void | |
*/ | |
function dokan_update_variation_product_vendor() { |
OlderNewer