Skip to content

Instantly share code, notes, and snippets.

@isS
isS / unserialize.php
Created March 16, 2023 08:49 — forked from phred/unserialize.php
Simple reliable and non-regex method to unserialize PHP session data
//
// This is the result of about an hour's delving into PHP's hairy-ass serialization internals.
// PHP provides a session_decode function, however, it's only useful for setting the contents of
// $_SESSION. Say, for instance, you want to decode the session strings that PHP stores in its
// session files -- session_decode gets you nowhere.
//
// There are a bunch of nasty little solutions on the manual page[1] that use pretty hairy regular
// expressions to get the job done, but I found a simple way to use PHP's unserialize and recurse
// through the string extracting all of the serialized bits along the way.
//
@isS
isS / pan.baidu.com.py
Created December 30, 2015 02:57 — forked from PeterDing/pan.baidu.com.py
百度云、百度网盘,递归下载自己的文件或分享的文件 -- keywords: pan.baidu.com, login, recursively, download -- # 移到仓库 https://github.com/PeterDing/iScript
#!/usr/bin/env python2
# vim: set fileencoding=utf8
import os
import sys
import requests
import urllib
import json
import re
import time
@isS
isS / 12306AutoSubmit.user.js
Created September 6, 2012 09:41 — forked from kevintop/12306AutoSubmit.user.js
12306 Auto Submit
/*
12306 Auto Submit => A javascript snippet to help you auto submit.
Copyright (C) 2011 Kevintop
Includes jQuery
Copyright 2011, John Resig
Dual licensed under the MIT or GPL Version 2 licenses.
http://jquery.org/license
Includes 12306.user.js
@isS
isS / 12306AutoSubmit.user.js
Created September 6, 2012 09:41 — forked from kevintop/12306AutoSubmit.user.js
12306 Auto Submit
/*
12306 Auto Submit => A javascript snippet to help you auto submit.
Copyright (C) 2011 Kevintop
Includes jQuery
Copyright 2011, John Resig
Dual licensed under the MIT or GPL Version 2 licenses.
http://jquery.org/license
Includes 12306.user.js
@isS
isS / gist:3245643
Created August 3, 2012 08:04 — forked from fxsjy/gist:3244607
Simple Memcached server in Javascript with 100 lines of code
/* Simple Memcached in Javascript
* @Author: Sun, Junyi
* @Email: ccnusjy@gmail.com
* @Date: 2012-8-3
*/
var net = require('net');
var store = {}
function handle_header(header,crlf_len){
var tup = header.split(" ")
@isS
isS / hl.js
Created October 22, 2011 17:11
Highlight search engine keywords for the landing page
/**
* 关键词高亮动态解析
*
* @author Saturn
* @since 1.0.0
* @return void
*/
var Highlighter={
highlight:
function(b,a){