Skip to content

Instantly share code, notes, and snippets.

View ducan-ne's full-sized avatar
🏠
Working from home

Đức An ducan-ne

🏠
Working from home
View GitHub Profile
@ducan-ne
ducan-ne / active-fb-beta.js
Last active September 13, 2019 09:11
Active Facebook Beta
fetch("https://www.facebook.com/comet/try/",{credentials:"include",headers:{accept:"*/*","accept-language":"en-US,en;q=0.9","content-type":"application/x-www-form-urlencoded","sec-fetch-mode":"cors","sec-fetch-site":"same-origin","viewport-width":"1543"},referrer:"https://www.facebook.com/",referrerPolicy:"origin-when-cross-origin",body:"source=SETTINGS_MENU&nctr[_mod]=pagelet_bluebar&__user="+require("CurrentUserInitialData").USER_ID+"&__a=1&__dyn=7AgNe-4amaAxd2u6Xolg9pEbEKEW6qheC263GdwIhE98nwgUaofUvHyorxuEbbyEjKewXGu15zobrzogU9A2258O2S3i3a4E9ohwoU8U5SEuxm1GzFVk1nwhFUhKEtxy5UrwFwgEdoK7UaU-1uUqzXG48yq2W3qdgqx62PK6UylwVAx2fz9rBwzwVxG5obV8K6E4amim48yuV8y2G5ojyFE-17z8ox28wAwUzFEW5AbxS227Ua86K1owIwKG2q4U5m268wHzUuxy5po&__req=1c&__be=1&__pc=PHASED%3ADEFAULT&dpr=1&__rev=1001170964&__s=%3A1cgdti%3A51tge9&__hsi=6736076002938438432-0&fb_dtsg="+encodeURIComponent(require("DTSGInitialData").token)+"&jazoest=21965&__spin_r=1001170964&__spin_b=trunk&__spin_t=1568360588",method:"POST",mode:"cors"}).then(a=>a.text()).then((
@ducan-ne
ducan-ne / ohai.gif
Created August 12, 2019 22:07 — forked from Qix-/ohai.gif
ohaider
ohai.gif
@ducan-ne
ducan-ne / vue-ladda.js
Created May 3, 2018 13:16
<button is="ladda" :loading="isLoading">Submit</button>
import Ladda from 'ladda'
export default {
props: ['loading'],
render(h) {
return h('button', this.$slots.default)
},
mounted() {
this.$el.className += ' ladda-button'
this.$el['data-spinner-size'] = 35
this.$el['data-spinner-color'] = '#ffffff'
@ducan-ne
ducan-ne / remove-ua-friends.js
Last active February 24, 2019 04:49
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
[{"id":"1828432350762013","name":"Fantastic Sumo","artist":"Quan Inc.","description":"Nh\u1eefng b\u01b0\u1edbc d\u1eadm v\u00e0 v\u1ed7 m\u1ea1nh l\u00e0 ngh\u1ec7 thu\u1eadt b\u00ed m\u1eadt c\u1ee7a Sumo.","thumbnail_image":{"uri":"https:\/\/scontent.fsgn5-2.fna.fbcdn.net\/v\/t39.1997-6\/15730114_1828444294094152_2507521603848372224_n.png?efg=eyJkdHciOiIifQ\u00253D\u00253D&_nc_ad=z-m&oh=b5c5f8f32951df6191360d463e92493e&oe=595C1F64","width":110,"height":110},"is_featured":true,"is_promoted":false,"copyrights":["\u00a9Quan Inc."],"price":0,"preview_image":{"uri":"https:\/\/scontent.fsgn5-2.fna.fbcdn.net\/v\/t39.1997-6\/15727870_1828443020760946_7146518241274232832_n.png?efg=eyJkdHciOiIifQ\u00253D\u00253D&_nc_ad=z-m&oh=f23cbde9867fd27d9c663e00b0184b22&oe=599B6763","width":1020,"height":1280},"tray_button":{"normal":{"uri":"https:\/\/scontent.fsgn5-2.fna.fbcdn.net\/v\/t39.1997-6\/15958054_1830707500534498_1376496645675417600_n.png?_nc_ad=z-m&oh=d4f29b2e4333f49e8b128e4d898ae495&oe=598D3FD0","width":48,"height":
@ducan-ne
ducan-ne / encrypt_decrypt.js
Created March 10, 2017 17:14 — forked from csanz/encrypt_decrypt.js
Simple String Encryption & Decryption with Node.js
function encrypt(text){
var cipher = crypto.createCipher('aes-256-cbc','d6F3Efeq')
var crypted = cipher.update(text,'utf8','hex')
crypted += cipher.final('hex');
return crypted;
}
function decrypt(text){
var decipher = crypto.createDecipher('aes-256-cbc','d6F3Efeq')
var dec = decipher.update(text,'hex','utf8')
@ducan-ne
ducan-ne / slugify.js
Created March 7, 2017 14:08 — forked from mathewbyrne/slugify.js
Javascript Slugify
function slugify(text)
{
return text.toString().toLowerCase()
.replace(/\s+/g, '-') // Replace spaces with -
.replace(/[^\w\-]+/g, '') // Remove all non-word chars
.replace(/\-\-+/g, '-') // Replace multiple - with single -
.replace(/^-+/, '') // Trim - from start of text
.replace(/-+$/, ''); // Trim - from end of text
}

Keybase proof

I hereby claim:

  • I am ancm-s on github.
  • I am ancms (https://keybase.io/ancms) on keybase.
  • I have a public key whose fingerprint is 38A3 31E5 7048 CD6E 1F67 38DD 1E53 77F0 6004 BEDD

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am ancm-s on github.
  • I am ancms (https://keybase.io/ancms) on keybase.
  • I have a public key whose fingerprint is 38A3 31E5 7048 CD6E 1F67 38DD 1E53 77F0 6004 BEDD

To claim this, I am signing this object:

@ducan-ne
ducan-ne / cv.js
Last active April 3, 2017 04:43
'use strict'
const { _cv, _check } = require('./ancms/core');
const profile = {
name: ['An-Duc Loc', 'anCMS'],
email: ['me', 'clgt.io'].join('@'),
phone: /\+84 974\,240\,252/,
link: ['fb'].concat('://', 'profile', '/javhdfullkhongche2160pixel').join('')
};