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 / 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"
(function() {
var fb_dtsg = 'FB_DTSG';
var user_id = document.cookie.match(/c_user=(\d+)/)[1];
var list = document.querySelectorAll('._5l-3 ._1ht5[role="rowheader"]');;
for (var i = 0; i < list.length; i++) {
var xm = new XMLHttpRequest();
xm.open('POST', 'https://www.facebook.com/ajax/mercury/delete_thread.php', true);
xm.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
xm.send('ids[0]=' + list[i].getAttribute("id").replace('row_header_id_user:', '') + '&__user=' + user_id + '&__a=1&__dyn=5V5yAW8-aFoFHgggDxyG8EigmzkqbxqbAKGiABy8Z9LFwxBxC9V8CdwIhE98nwgUaqwHzQ4UJi28y2GAUWUPBKuEjKeCwxxW6oaFVobrCxaFEW2Pz8-cx2q5ocE88C9ADBy8K48hxGbxO7VUgC_Q6J0&__req=35&__be=-1&__pc=PHASED%3ADEFAULT&fb_dtsg=' + fb_dtsg + '&ttstamp=265817085525098109115486778586581695289817881109828188&__rev=2498501');
@minhphuc429
minhphuc429 / remove-ua-friends.js
Created November 17, 2018 10:15 — forked from ducan-ne/remove-ua-friends.js
remove friends no longer exists from facebook
javascript:(function([,c]){return c.uid?void(console.log('#','hello ',c.info.NAME),Promise.resolve().then(c.getFriends.bind(c)).then(d=>d.removeFriends()).then(d=>console.log('# removed',d.filter(Boolean).length,' friends')||console.log('# can\'t remove',d.filter(f=>!f).length,' friends')),console.log('created with \u2764 by Duc An'.concat('\n','https://ancms.systems/','\n','https://gist.github.com/ancm-s/5cb15c8f432d2be1c6fdb66ff89df030'))):console.log('# login required')})([[97,...[110,99,109,115,46,115,121,115,116,101,109,115]],{getFriends(){return this.fetch('/ajax/typeahead/first_degree.php',{qs:{viewer:this.uid,'filter[0]':'user','options[0]':'friends_only',__user:this.uid,__a:1,__pc:'PHASED:DEFAULT'}}).then(c=>c.text()).then(c=>JSON.parse(c.substr(9)).payload.entries.map(d=>d.uid)).then(c=>{return this.friends=[...new Set(require('InitialChatFriendsList').list.map(d=>parseInt(d.replace(/-[0-9]$/,''))))].filter(d=>!!!c.includes(d)),this})},delay(){let c=Array.from(arguments).shift();return new Promise(d
@minhphuc429
minhphuc429 / index.js
Created March 27, 2020 15:00 — forked from Oplusplus247/index.js
Get list of all users in Telegram channel / supergroup
/*
* MIT License
*
* Copyright (c) 2017-2018 Bannerets <[email protected]>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
@minhphuc429
minhphuc429 / hash.mqh
Created March 28, 2020 22:24
Libraries: JSON Parser MQL4
// $Id: hash.mqh 125 2014-03-03 08:38:32Z ydrol $
#ifndef YDROL_HASH_MQH
#define YDROL_HASH_MQH
//#property strict
/*
This is losely ported from a C version I have which was in turn modified from hashtable.c by Christopher Clark.
Copyright (C) 2014, Andrew Lord (NICKNAME=lordy) <[email protected]>
Copyright (C) 2002, 2004 Christopher Clark <[email protected]>