Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Le Duy Quang quangbahoa

🎯
Focusing
Block or report user

Report or block quangbahoa

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@quangbahoa
quangbahoa / functions.php
Created Sep 19, 2019 — forked from lukecav/functions.php
Disable Elementor overview dashboard widget in WordPress
View functions.php
function disable_elementor_dashboard_overview_widget() {
remove_meta_box( 'e-dashboard-overview', 'dashboard', 'normal');
}
add_action('wp_dashboard_setup', 'disable_elementor_dashboard_overview_widget', 40);
@quangbahoa
quangbahoa / function.php
Created Apr 6, 2019 — forked from tanmay27vats/function.php
Remove "Product Type/Product Data" Dropdown Options - WooCommerce
View function.php
add_filter( 'product_type_selector', 'remove_product_types' );
function remove_product_types( $types ){
unset( $types['grouped'] );
unset( $types['external'] );
unset( $types['variable'] );
return $types;
}
@quangbahoa
quangbahoa / flatsome3-custom-post-type-support.php
Created Apr 1, 2019 — forked from webseo-onilne/flatsome3-custom-post-type-support.php
Integrate custom post types into Flatsome 3 page builder application using a child theme; providing: (1.) Page Builder Editor support for custom post types, and (2.) Integration with page builder post element components.
View flatsome3-custom-post-type-support.php
<?php
/**
* Integrate custom post types into Flatsome 3 page builder application using a child theme.
*
* This will provide:
*
* 1. Page Builder Editor support for custom post types
* 2. Integration with page builder post element components
**/
View decoder.php
<!doctype html>
<html>
<head>
<title>"PHP Encode v1.0 by zeura.com" decoder =))</title>
<meta charset="utf-8">
</head>
<body>
<form method="POST">
<h1>Decode tool for <a href="http://www.phpencode.org">http://www.phpencode.org</a></h1>
<textarea name="code" rows="10" style="width: 100%" placeholder="Paste code here"></textarea><br />
@quangbahoa
quangbahoa / cdn-jquery.php
Last active Feb 24, 2019 — forked from Shelob9/cdn-jquery.php
Replace WordPress' jQuery with CDN jQuery of the right version
View cdn-jquery.php
add_action( 'init', function(){
if ( ! is_admin()) {
if( is_ssl() ){
$protocol = 'https';
}else {
$protocol = 'http';
}
/** @var WP_Scripts $wp_scripts */
global $wp_scripts;
@quangbahoa
quangbahoa / db-connect-test.php
Created Jan 11, 2019 — forked from chales/db-connect-test.php
Script for a quick PHP MySQL DB connection test.
View db-connect-test.php
<?php
# Fill our vars and run on cli
# $ php -f db-connect-test.php
$dbname = 'name';
$dbuser = 'user';
$dbpass = 'pass';
$dbhost = 'host';
$connect = mysql_connect($dbhost, $dbuser, $dbpass) or die("Unable to Connect to '$dbhost'");
@quangbahoa
quangbahoa / mail-test.php
Created Jul 25, 2018 — forked from Dreyer/mail-test.php
Quick & Dirty PHP Mail Test Script
View mail-test.php
<?php
/*
DONT FORGET TO DELETE THIS SCRIPT WHEN FINISHED!
*/
ini_set( 'display_errors', 1 );
error_reporting( E_ALL );
$from = 'webmaster@example.com';
@quangbahoa
quangbahoa / gist:65c8c0a8773aa4788a2acaac46763368
Last active Feb 20, 2019 — forked from vicnicius/gist:8685678
Script for optimizing all .jpg images inside a folder, using jpegoptim
View gist:65c8c0a8773aa4788a2acaac46763368
find -type f -name "*.jpg" -exec jpegoptim --strip-all {} \;
find -name '*.png' -print0 | xargs -0 optipng -o7
`
find . -iname ‘*.jpg’ -exec jpegoptim –max=80 –all-progressive –totals –strip-all {} \;
find . -iname ‘*.JPG’ -exec jpegoptim –max=80 –all-progressive –totals –strip-all {} \;
find . -iname ‘*.jpeg’ -exec jpegoptim –max=80 –all-progressive –totals –strip-all {} \;
find . -iname ‘*.JPEG’ -exec jpegoptim –max=80 –all-progressive –totals –strip-all {} \;
`
View gist:aef724fbfc43a097aa46a6ca7c5e2bde
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~* .php$ {
deny all;
}
location ~ ^(index\.php)?$ {
View gist:805e49ec9623758d1612102e755cb425
server {
server_name www.cantwo.net;
rewrite ^(.*) http://cantwo.net$1 permanent;
}
server {
listen 80;
access_log off;
# access_log /home/cantwo.net/logs/access_log;
error_log off;
# error_log /home/cantwo.net/logs/error.log;
You can’t perform that action at this time.