List of useful npx (NPM Package Runner) commands.
Using NPX we can execute/run node binaries without the need to install it locally or globally.
<?php | |
// phpcs:ignoreFile | |
define( 'EXPOSED_DOMAIN', 'example.sharedwithexpose.com' ); | |
// Load only if we are running under Expose. | |
if ( empty( $_SERVER['HTTP_X_ORIGINAL_HOST'] ) || $_SERVER['HTTP_X_ORIGINAL_HOST'] !== EXPOSED_DOMAIN ) { | |
return; | |
} |
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Infinite Scroll Example</title> | |
<!-- Styles --> | |
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous"> | |
<link rel="stylesheet" href="styles.css"> | |
<!-- Scripts --> | |
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script> |
((document, location, navigator) => { | |
const domain = location.hostname.split(".") | |
const match = document.cookie.match(/(^|; ?)_ga=GA1\.\d\.(\d+\.\d+)(;|$)/) | |
// use existing client id or generate one | |
const cid = match ? match[2] : ~~(2147483648 * Math.random()) + "." + ~~(Date.now() / 1000) | |
// set cookie at highest possible domain level | |
for (let i = domain.length; i--;) { | |
const cookie = `_ga=GA1.${domain.length - i}.${cid}` |
<?php | |
class ResponsiveOEmbeds { | |
/** | |
* Regex patterns for matching specific embeddable URLs | |
* | |
* @var array | |
*/ |
List of useful npx (NPM Package Runner) commands.
Using NPX we can execute/run node binaries without the need to install it locally or globally.
#!/bin/bash | |
# IMPORTANT: Don't forget to logout from your Apple ID in the settings before running it! | |
# IMPORTANT: You will need to run this script from Recovery. In fact, macOS Catalina brings read-only filesystem which prevent this script from working from the main OS. | |
# This script needs to be run from the volume you wish to use. | |
# E.g. run it like this: cd /Volumes/Macintosh\ HD && sh /Volumes/Macintosh\ HD/Users/sabri/Desktop/disable.sh | |
# WARNING: It might disable things that you may not like. Please double check the services in the TODISABLE vars. | |
# Get active services: launchctl list | grep -v "\-\t0" | |
# Find a service: grep -lR [service] /System/Library/Launch* /Library/Launch* ~/Library/LaunchAgents |
<?php | |
add_filter( 'woocommerce_order_actions', function ( $actions ) { | |
// Unset whatever actions you don't need available in the | |
// WooCommerce order edit screen. | |
unset( $actions['send_order_details_admin'] ); | |
unset( $actions['send_order_details'] ); | |
unset( $actions['regenerate_download_permissions'] ); | |
<?php | |
namespace WpLandingKitPlugin; | |
use WP_CLI; | |
use WP_CLI_Command; |
<?php | |
class View { | |
public static $view_dir = ''; | |
/** | |
* Render View Template With Data |
<?php | |
$config = include 'config.php'; | |
echo $config['some']; // 'config' |