Skip to content

Instantly share code, notes, and snippets.

View enqtran's full-sized avatar

enqtran enqtran

View GitHub Profile
@enqtran
enqtran / [WP] Disable XML-RPC in WordPress
Created November 26, 2018 01:58
Disable XML-RPC in WordPress
Disabling XML-RPC
1. Locate your theme folder (usually in “wp-content/themes/”), and open the “functions.php” file.
2. Paste the following commands to the end of the file:
// Disable use XML-RPC
add_filter( 'xmlrpc_enabled', '__return_false' );
Blocking Access to XML-RPC file .htaccess
@enqtran
enqtran / [React Native] Component Kits for React Native
Last active March 6, 2018 08:09
Component Kits for React Native
https://github.com/xinthink/react-native-material-kit
https://github.com/react-native-material-design/react-native-material-design
https://github.com/react-native-training/react-native-elements
https://nativebase.io/
https://github.com/akveo/react-native-ui-kitten
this.refs.messages_scroll_area.scrollTop = this.refs.messages_scroll_area.scrollHeight
import React, { Component } from 'react';
import { findDOMNode } from 'react-dom';
import screenfull from 'screenfull';
import ReactPlayer from 'react-player';
const MULTIPLE_SOURCES = [
{ src: 'http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4', type: 'video/mp4' },
{ src: 'http://clips.vorwaerts-gmbh.de/big_buck_bunny.ogv', type: 'video/ogv' },
{ src: 'http://clips.vorwaerts-gmbh.de/big_buck_bunny.webm', type: 'video/webm' }
]
@enqtran
enqtran / [WordPress] Sort possiton metabox tagsdiv
Created September 13, 2017 00:39
sort possiton metabox tagsdiv
/**
* sort possiton metabox tagsdiv
*/
if ( ! function_exists( 'set_possition_metaboxes' ) ) {
function set_possition_metaboxes() {
$meta_value = array(
'side' => array('introduce_plan, estimated_budget_plan, people_plan,amount,amount_2,choise_shop'),
'normal' => array('introduce_plan, estimated_budget_plan, people_plan,amount,amount_2,choise_shop'),
'advanced' => array('introduce_plan, estimated_budget_plan, people_plan,amount,amount_2,choise_shop'),
);
@enqtran
enqtran / [ReactJS] Detect Scrolls To Bottom
Last active May 25, 2022 19:16
[ReactJS] Detect Scrolls To Bottom
constructor(props) {
super(props);
this.state = {
height: window.innerHeight,
message: 'not at bottom'
};
this.handleScroll = this.handleScroll.bind(this);
}
handleScroll() {
const windowHeight = "innerHeight" in window ? window.innerHeight : document.documentElement.offsetHeight;
@enqtran
enqtran / [JS] Number format
Last active June 20, 2017 01:26
[JS] Number format // 12,3456,789
//input: 123456789
function number_format(number) {
var value_number = number.toLocaleString({minimumFractionDigits: 0});
return value_number;
}
//output: 123,456,789
// Fix
$('.button').unbind().bind('click', function(event) {
event.preventDefault();
//ajax method ....
});
@enqtran
enqtran / [VUE] Setup
Created June 6, 2017 04:24
setup vuejs
npm install vue-cli -g
vue init webpack-simple startbase
cd nam_project
npm install
npm run dev
@enqtran
enqtran / [MongoDB] SQL Terms, Functions, and Concepts MongoDB Aggregation Operators
Created June 2, 2017 07:59
SQL Terms, Functions, and Concepts MongoDB Aggregation Operators
WHERE $match
GROUP BY $group
HAVING $match
SELECT $project
ORDER BY $sort
LIMIT $limit
SUM() $sum
COUNT() $sum
join $lookup - New in version 3.2.