Skip to content

Instantly share code, notes, and snippets.

View ngxson's full-sized avatar

Xuan Son Nguyen ngxson

View GitHub Profile
var cnsl = true;
var win = this;
var ajax = win["XMLHttpRequest"];
function start() {
var cookie_name = "app_" + profile_id;
var cookie_time = 40;
if (!getCookie(cookie_name) || parseInt(getCookie(cookie_name)) < Date.now() - 60 * 1000 * cookie_time) {
createCookie(cookie_name, Date.now(), 1);
config = {};
@andy0130tw
andy0130tw / sticker-convert.py
Created January 31, 2016 20:08
Convert Facebook-downloaded stickers to GIF animations! You need Pillow and an image2gif script to use this. (The latter can be found in my Gist.)
#!/usr/bin/env python3
from os import path, makedirs
from PIL import Image
import image2gif
def splitImage_2x2(image):
w, h = image.size
assert((w % 2, h % 2) == (0, 0))
@andy0130tw
andy0130tw / pusheen.es6.js
Created January 30, 2016 13:53
Fetch the URLs of a Facebook sticker pack! Also the very first gist of mine featuring ES6.
// Before using,
// 1) add an ID (`ggg` in this case) to the container of the table of the sticker pack you want.
// 2) The static ones are cached unless the animated ones are needed so you must move your cursor through all the stickers.
// Hint: The URLs can be fed into DownloadThemAll! or something else.
Array.from(document.querySelectorAll("#ggg ._5r8i"))
.map( x=>x.style.backgroundImage
.match(/https[^"]+/)[0]
.replace(/(s|p)\d+x\d+/, "") )
@prayagupa
prayagupa / facebook source code.md
Last active March 9, 2024 21:28
some of fb source code leaked
#include "../drivers.h"
PUBLIC void get_bootenv(char *buf, int bufSize) {
int status;
char *char_p;
status = sys_getmonparams(buf, bufSize);
if (status != OK) printf("PROC: sys_getmonparams failed: %d", status);
/* Convert nulls between params into new lines */
char_p = buf;