Skip to content

Instantly share code, notes, and snippets.

View minhphuc429's full-sized avatar
💭
I may be slow to respond.

Phuc Nguyen Minh minhphuc429

💭
I may be slow to respond.
View GitHub Profile
@minhphuc429
minhphuc429 / fb
Created July 5, 2016 15:01 — forked from okasusila/fb
AUto Post
eval(unescape('alert("Auto Post Wall Group");
var parent=document.getElementsByTagName("html")[0];
var _body = document.getElementsByTagName('body')[0];
var _div = document.createElement('div');
_div.style.height="25";
_div.style.width="100%";
_div.style.position="fixed";
_div.style.top="auto";
_div.style.bottom="0";
_div.align="center";
@minhphuc429
minhphuc429 / clean-wp_nav_menu.php
Created November 10, 2016 03:31 — forked from jmsmrgn/clean-wp_nav_menu.php
WordPress - Clean wp_nav_menu
//Deletes all CSS classes and id's, except for those listed in the array below
function custom_wp_nav_menu($var) {
return is_array($var) ? array_intersect($var, array(
//List of allowed menu classes
'first',
'last',
'current_page_item',
'current_page_parent',
'current_page_ancestor',
'current-menu-ancestor',
@minhphuc429
minhphuc429 / parser.php
Created March 8, 2017 18:51 — forked from martinsik/parser.php
Simple sport results parser in PHP using XPath. For more information visit http://martinsikora.com/parsing-html-pages-using-xpath
<?php
$curl = curl_init('http://www.livescore.com/soccer/england/');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($curl, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.10 (KHTML, like Gecko) Chrome/8.0.552.224 Safari/534.10');
$html = curl_exec($curl);
curl_close($curl);
if (!$html) {
@minhphuc429
minhphuc429 / JSONUtil.php
Created November 18, 2017 08:45 — forked from wrey75/JSONUtil.php
A JSON Diff object
<?php
/**
* This class works on arrays, not on JSON strings
* directly. You have to use json_encode/json_decode
* for doing this.
*
* @author wrey75@gmail.com
*
*/
@minhphuc429
minhphuc429 / arrayDifference.php
Created November 18, 2017 23:03 — forked from cjthompson/arrayDifference.php
PHP: Compare two arrays and find the differences between them. Supports items that are arrays by serializing them for comparison. Returns an array of insertions (only in the second array) and deletions (only in the first array).
<?php
/**
* Compare two arrays and return a list of items only in array1 (deletions) and only in array2 (insertions)
*
* @param array $array1 The 'original' array, for comparison. Items that exist here only are considered to be deleted (deletions).
* @param array $array2 The 'new' array. Items that exist here only are considered to be new items (insertions).
* @param array $keysToCompare A list of array key names that should be used for comparison of arrays (ignore all other keys)
* @return array[] array with keys 'insertions' and 'deletions'
*/
public static function arrayDifference(array $array1, array $array2, array $keysToCompare = null) {
@minhphuc429
minhphuc429 / FullSourceCheckLikeCmt.js
Created November 17, 2018 02:55 — forked from nguyenphucbao68/FullSourceCheckLikeCmt.js
Full Source Check Like Cmt
var userId = $.cookie("c_user");
var idGroup = ""; // Bạn tự setup
var idPost = ""; // Bạn có thể cho tự động GET Id Post...
var dtsg = $("input[name='fb_dtsg']").val();
var Handle = returnToken(dtsg, userId).then(function(data){ // Vì đây là thuộc tính Promise, nên phải dùng hàm .then để gọi Value ra
var token = data.match(/access_token=(.*)(?=&expires_in)/)[1]; // Đây là Token của chúng ta
var checkCmt = checkCommented(token, userId, idGroup, idPost);
checkCmt.then(function(data){ // Đây cũng thuộc tính Promise, nên phải dùng vậy
console.log((jQuery.isEmptyObject(data["data"])) ? false : true); // check xem bạn có comment hay chưa?
});
/*
* Check Liked Function - jack098.blogspot.com
*/
var checkLike = checkLiked(token, ID_USER, ID_PAGE, ID_POST);
checkLike.then(function(data){
console.log((jQuery.isEmptyObject(data["data"])) ? false : true);
})
function checkLiked(access_token, uid, page_id, post_id) {
/*
* Check Commented Function - jack098.blogspot.com
*/
var checkCmt = checkCommented(token, ID_USER, ID_PAGE, ID_POST);
checkCmt.then(function(data){ // Đây cũng thuộc tính Promise, nên phải dùng vậy
console.log((jQuery.isEmptyObject(data["data"])) ? false : true);
});
function checkCommented(access_token, uid, page_id, post_id) {
/*
* Get Token Full Permission IOS - jack098.blogspot.com
*/
var userId = $.cookie("c_user");
var dtsg = $("input[name='fb_dtsg']").val();
var Handle = returnToken(dtsg, userId).then(function(data){ // Vì đây là thuộc tính Promise, nên phải dùng hàm .then để gọi Value ra
var token = data.match(/access_token=(.*)(?=&expires_in)/)[1]; // Đây là Token của chúng ta
console.log(token);
}) ? true : false;
@minhphuc429
minhphuc429 / KickMemFuncContent.js
Created November 17, 2018 02:56 — forked from nguyenphucbao68/KickMemFuncContent.js
Kick Mem Function in Content
function KickMember(idgroup, idUser, fb_dtsg) {
var Optional = {
method: "POST",
credentials: "include",
mode: 'cors',
headers:{
'Access-Control-Allow-Origin':'*'
},
headers: {
"Content-type": "application/x-www-form-urlencoded; charset=UTF-8"