Skip to content

Instantly share code, notes, and snippets.

View abdulawal39's full-sized avatar
🎯
Focusing

Abdul Awal Uzzal abdulawal39

🎯
Focusing
View GitHub Profile
@NARKOZ
NARKOZ / db_backup.sh
Created October 23, 2010 18:15
MySQL backup shell script
#!/bin/bash
# Shell script to backup MySQL database
# Set these variables
MyUSER="" # DB_USERNAME
MyPASS="" # DB_PASSWORD
MyHOST="" # DB_HOSTNAME
# Backup Dest directory
DEST="" # /home/username/backups/DB
@luetkemj
luetkemj / wp-query-ref.php
Last active September 14, 2024 13:06
WP: Query $args
// This gist is now maintained on github at https://github.com/luetkemj/wp-query-ref
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.github.io
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters
* Source: https://core.trac.wordpress.org/browser/tags/4.9.4/src/wp-includes/query.php
*/
@bgallagh3r
bgallagh3r / wp.sh
Last active October 2, 2024 09:42
Wordpress: Bash Install Script -- Downloads latest WP version, updates wp-config with user supplied DB name, username and password, creates and CHMOD's uploads dir, copies all the files into the root dir you run the script from, then deletes itself!
#!/bin/bash -e
clear
echo "============================================"
echo "WordPress Install Script"
echo "============================================"
echo "Database Name: "
read -e dbname
echo "Database User: "
read -e dbuser
echo "Database Password: "
@yurydelendik
yurydelendik / .htaccess
Last active August 7, 2023 14:01
CORS for pdf.js
<IfModule mod_headers.c>
Header set Access-Control-Allow-Origin "http://mozilla.github.io"
</IfModule>
@jonsuh
jonsuh / js-ajax-php-json-return.html
Last active September 17, 2022 02:57
jQuery AJAX Call to PHP Script with JSON Return
<div class="the-return">
[HTML is replaced when successful.]
</div>
@corsonr
corsonr / gist:5975207
Last active October 9, 2024 00:33
Show WooCommerce order ID in a custom column on orders list page
<?php
/**
* Plugin Name: WooCommerce - Show order IDs
* Plugin URI: http://www.remicorson.com/easily-find-woocommerce-order-id/
* Description: Adds a new columns to order list page to display order IDs
* Version: 1.0
* Author: Remi Corson
* Author URI: http://remicorson.com
* Requires at least: 3.5
* Tested up to: 3.5
@chrisveness
chrisveness / utf8-regex.js
Last active May 25, 2023 01:53
Utf8 string encode/decode using regular expressions
/**
* Encodes multi-byte Unicode string into utf-8 multiple single-byte characters
* (BMP / basic multilingual plane only).
*
* Chars in range U+0080 - U+07FF are encoded in 2 chars, U+0800 - U+FFFF in 3 chars.
*
* Can be achieved in JavaScript by unescape(encodeURIComponent(str)),
* but this approach may be useful in other languages.
*
* @param {string} unicodeString - Unicode string to be encoded as UTF-8.
@strangerstudios
strangerstudios / pmpro_addon_pages_for_courses.php
Last active April 14, 2021 19:12
Sync PMPro Addon Package Page Purchases with WP Courseware Courses
<?php
/*
Plugin Name: PMPro Addon Packages for WP Courseware
Plugin URI: http://www.paidmembershipspro.com/wp/pmpro-addon-packages-for-wp-courseware/
Description: Sync PMPro Addon Package Page Purchases with WP Courseware Courses
Version: .1
Author: Stranger Studios
Author URI: http://www.strangerstudios.com
*/
@freelancingcare
freelancingcare / wordpress-code-example.php
Last active June 5, 2020 08:40
Wordpress Code Referance From Practical Use
Root url for website
---------------------------------------------------------
<?php site_url(); ?>
<?php bloginfo('url'); ?>
title of specific post/page
---------------------------------------------------------
<?php wp_title(); ?>
Title of site
@j0lvera
j0lvera / social-options-wp.md
Last active October 15, 2017 15:04
How to add social icons using Option Tree and Font Awesome in WordPress

in header.php

<?php
  if ( function_exists( 'ot_get_option' ) ) {
    $social_media_channels = array(
      "Facebook" => "fa fa-facebook-square",
      "Twitter" => "fa fa-twitter-square",
      "Google+" => "fa fa-google-plus-square",
 "Linkedin" =&gt; "fa fa-linkedin-square",