Skip to content

Instantly share code, notes, and snippets.

View MeK-KeM's full-sized avatar
😁
Be happy

Komiljonov Rahimjon MeK-KeM

😁
Be happy
  • Milky way, Earth
View GitHub Profile
// Get The Page ID You Need
get_option( 'woocommerce_shop_page_id' );
get_option( 'woocommerce_cart_page_id' );
get_option( 'woocommerce_checkout_page_id' );
get_option( 'woocommerce_pay_page_id' );
get_option( 'woocommerce_thanks_page_id' );
get_option( 'woocommerce_myaccount_page_id' );
get_option( 'woocommerce_edit_address_page_id' );
get_option( 'woocommerce_view_order_page_id' );
get_option( 'woocommerce_terms_page_id' );
@MeK-KeM
MeK-KeM / server.js
Created May 14, 2020 06:41 — forked from ryanoglesby08/server.js
A node.js SPA server that serves static files and an index.html file for all other routes.
/*
Incredibly simple Node.js and Express application server for serving static assets.
Given as an example from the React Router documentation (along with examples
using nginx and Apache):
- https://github.com/ReactTraining/react-router/blob/master/docs/guides/Histories.md#browserhistory
*/
const express = require('express');
const path = require('path');
@MeK-KeM
MeK-KeM / wp_td_functions.php
Last active May 8, 2020 04:56
WordPress Theme Development
<?php
/* 1. CONSTANTS */
define( 'THEMEROOT', get_stylesheet_directory_uri() );
define( 'CSS', THEMEROOT . '/css' );
define( 'JS', THEMEROOT . '/js' );
define( 'IMG', THEMEROOT . '/images' );
/* 2. ACF options page */
if( function_exists('acf_add_options_page') ) {
@MeK-KeM
MeK-KeM / wp_pd_activation_hook.php
Last active May 3, 2020 06:48
WordPress Plugin Development
register_activation_hook( __FILE__, 'wfm_activate' );
function wfm_activate()
{
}
@MeK-KeM
MeK-KeM / cookie-setting
Created January 28, 2019 10:00 — forked from anonymous/cookie-setting
Setting a cookie
@MeK-KeM
MeK-KeM / .gitignore
Created January 25, 2019 06:45 — forked from octocat/.gitignore
Some common .gitignore configurations
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
@MeK-KeM
MeK-KeM / separate_number_digits.php
Last active September 27, 2018 12:44
Separate number digits
<?php
/* Separate number digits.
* 12345 -> 1, 2, 3, 4, 5
*/
$count = 12345;
$digits = array();
for ($i = 0; $i < strlen($count); $i++) {
$digits[] = substr($count, $i, 1);