Skip to content

Instantly share code, notes, and snippets.

View onnayokheng's full-sized avatar

Onnay Okheng onnayokheng

View GitHub Profile
@onnayokheng
onnayokheng / gist:9e8c70db01bad6926ef80dd3653db58d
Created January 1, 2020 02:50
Set global variable for mysql 8
SET GLOBAL validate_password.LENGTH = 4;
SET GLOBAL validate_password.policy = 0;
SET GLOBAL validate_password.mixed_case_count = 0;
SET GLOBAL validate_password.number_count = 0;
SET GLOBAL validate_password.special_char_count = 0;
SET GLOBAL validate_password.check_user_name = 0;
ALTER USER 'root'@'localhost' IDENTIFIED BY 'root';
FLUSH PRIVILEGES;
@onnayokheng
onnayokheng / index.html
Created September 3, 2019 16:16
HTML Code Game Pacman
<!DOCTYPE html>
<html>
<head>
<title>Maintenance - Moota.co</title>
<link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Permanent+Marker">
<style type="text/css">
body {
background-color: black;
}
/**
* Theme Name: Name of theme
* Theme URI: https://wordpress.org/themes/twentyseventeen/
* Author: the WordPress team
* Author URI: https://wordpress.org/
* Description: Description theme
* Version: 1.0.0
* Text Domain: slug-theme
* Tags: one-column, two-columns
* License: GNU General Public License v2 or later
@onnayokheng
onnayokheng / functions.php
Last active July 13, 2018 15:28
Add countdown on thankyou page
<?php
/**
* Add countdown into view order and thankyou page
* @author: Onnay Okheng (@onnayokheng)
*/
add_action( 'woocommerce_thankyou', 'matamerah_add_countdown_checkout' );
add_action( 'woocommerce_view_order', 'matamerah_add_countdown_checkout' );
function matamerah_add_countdown_checkout($order_id = 0)
{
@onnayokheng
onnayokheng / query-inventory-multiple-tables.sql
Created March 18, 2018 02:36
Query for calculate inventory item from multiple tables
SELECT
inventories.product_id,
products.name as product_name,
stock_create.stock_production as total_stock_production,
SUM(inventories.qty) as total_stock_in,
SUM(distribusi.stock) as total_stock_in_warehouse,
SUM(inventories.qty - delivery.stock) as total_stock_current,
delivery.stock as total_stock_out
FROM inventories
LEFT JOIN (
!function(e){function t(a){if(n[a])return n[a].exports;var r=n[a]={i:a,l:!1,exports:{}};return e[a].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var n={};t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,a){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:a})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=134)}([function(e,t,n){(function(e){!function(t,n){e.exports=n()}(0,function(){"use strict";function t(){return Ma.apply(null,arguments)}function a(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function r(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function i(e){var t;for(t in e)return!1;return!0}function o(e){return void 0===e}function s(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function l(e){return e instanceof Date||"[object Dat
@onnayokheng
onnayokheng / coundown-evergreen.php
Created March 15, 2017 06:47
replace file ini
<?php
namespace ElementorLandingPress\Widgets;
use Elementor\Controls_Manager;
use Elementor\Group_Control_Border;
use Elementor\Group_Control_Typography;
use Elementor\Scheme_Color;
use Elementor\Scheme_Typography;
use Elementor\Utils;
use Elementor\Widget_Base;
require "formula"
class Mongodb < Formula
homepage "http://www.mongodb.org/"
url "http://downloads.mongodb.org/src/mongodb-src-r2.6.5.tar.gz"
sha1 "f5a68505a0de1152b534d62a8f0147d258d503a0"
bottle do
sha1 "d573717ca7c67455680a6823de210c940faf9ac6" => :mavericks
sha1 "f7d2a0711e3ac09fd61bcb243360c1a07fb83233" => :mountain_lion
@onnayokheng
onnayokheng / get-thumbnail-youtube
Last active August 29, 2015 14:06
get youtube thumbnail from content
<?php
/* Get thumbnail from Video Embed code */
function nesia_get_video_image() {
global $post;
if (preg_match('%(?:youtube(?:-nocookie)?\.com/(?:[^/]+/.+/|(?:v|e(?:mbed)?)/|.*[?&]v=)|youtu\.be/)([^"&?/ ]{11})%i', $post->post_content, $match)) {
$video_id = $match[1];
} else {
return false;
}
@onnayokheng
onnayokheng / Amazing of WooCommerce
Last active August 29, 2015 14:01
Amazing of WooCommerce
Main Link --> http://www.woothemes.com/woocommerce/
See the video, it's great!
**See WooCommerce from Usability**
-------------------------------
- Discount
- Unlimited Coupon Code (http://take.ms/5wfoh)
- Variation Products (http://take.ms/SfGy6)
- SKU
- Price and Sale Price (http://take.ms/krx26)