This file contains hidden or 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
git init | |
git config --list --show-origin | |
git config --global user.name 'dev-w3' | |
git config --global user.email '[email protected]' | |
git config --list | |
git remote add origin https://github.com/dev-w3/nodeone.git | |
git status | |
git add . | |
git stash |
This file contains hidden or 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
{% comment %} | |
if combine_pretext is false, the text before the first <h6> will be shown above all tabs, otherwise added to the first tab | |
{% endcomment %} | |
{% assign combine_pretext = false %} | |
{% assign description = tabbed-description | default: product.description %} | |
{% if description contains "<h6>" %} | |
{% assign tab_heads = '' %} | |
{% assign tab_texts = '' %} | |
{% assign pretext = '' %} |
This file contains hidden or 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 | |
#CSV Manager for WP Store Locator | |
#https://wordpress.org/plugins/wp-store-locator/ | |
// Redirect to 404 if script is accessed directly | |
if ( ! defined("ABSPATH") ) { | |
header("Location: http://{$_SERVER['HTTP_HOST']}/404"); | |
die; | |
}; | |
This file contains hidden or 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
jQuery(document).ready(function ($) { | |
let alreadyThere = false; | |
$.fn.isVisible = function (topSet = 0) { | |
_this = $(this); | |
_this = (typeof _this == 'object' || typeof _this == 'function') ? _this.get(0) : _this; | |
const rect = _this.getBoundingClientRect(); | |
return ( | |
rect.bottom >= 0 && |
This file contains hidden or 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( 'rest_api_init', 'register_api_hooks' ); | |
add_action( 'rest_api_init', 'wp_rest_user_endpoints' ); | |
function register_api_hooks() { | |
register_rest_route( | |
'apihandle/', '/login/', | |
array( | |
'methods' => 'POST', | |
'callback' => 'login_api', |
This file contains hidden or 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 | |
$url = "http://stackoverflow.com/"; | |
$ch = curl_init(); | |
$timeout = 5; | |
curl_setopt($ch, CURLOPT_URL, $url); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); | |
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout); | |
$html = curl_exec($ch); | |
curl_close($ch); |
This file contains hidden or 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 | |
$curl = curl_init('https://www.domain.com/outwell/posadas-foldaway-bed-single'); | |
curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE); | |
curl_setopt($curl,CURLOPT_USERAGENT,'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13'); | |
$page = curl_exec($curl); | |
$related_products = array(); | |
// Get Content Inside of productdetail_lblProductName Div/ Regex Match | |
$regex = '/<div id="productdetail_lblProductName">(.*?)<\/div>/s'; |
This file contains hidden or 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
// API Reference: https://www.wix.com/velo/reference/api-overview/introduction | |
// “Hello, World!” Example: https://learn-code.wix.com/en/article/1-hello-world | |
import wixData from 'wix-data'; | |
import { getJSON } from 'wix-fetch'; | |
import {local} from 'wix-storage'; | |
export function getrentallistings () { | |
const mySecret = 'key_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'; |
This file contains hidden or 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 | |
## Function to set file permissions to 0644 and folder permissions to 0755 | |
function AllDirChmod( $dir = "./", $dirModes = 0755, $fileModes = 0644 ){ | |
$d = new RecursiveDirectoryIterator( $dir ); | |
foreach( new RecursiveIteratorIterator( $d, 1 ) as $path ){ | |
if( $path->isDir() ) chmod( $path, $dirModes ); | |
else if( is_file( $path ) ) chmod( $path, $fileModes ); | |
} |
This file contains hidden or 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 | |
add_filter('woocommerce_available_payment_gateways', '_hide_payment_gateways', 20, 1 ); | |
function _hide_payment_gateways( $available_gateways){ | |
// Not in backend (admin) | |
if( is_admin() ) | |
return $available_gateways; | |
// If at least a coupon is applied | |
if( sizeof( WC()->cart->get_applied_coupons() ) > 0 ){ |
OlderNewer