Skip to content

Instantly share code, notes, and snippets.

HE Shi-Jun hax

Block or report user

Report or block hax

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
hax / koa-confusing-accessors.js
Last active Aug 29, 2015
confusing accessors in koa
View koa-confusing-accessors.js
// See
// start: nvm run 0.11 --harmony koa-confusing-accessors
// test: curl -d '{"test":"ok"}' -H 'Content-Type: application/json' http://localhost:3000/
var koa = require('koa');
var app = module.exports = koa();
app.use(function *(next){
if (this.method === 'POST') {
this.body = '<?xml version="1.0">'
hax / intl-typehint-bug.php
Last active Aug 29, 2015
typehint bug of Intl extension in PHP 5.5
View intl-typehint-bug.php
$f = new ReflectionFunction('intltz_from_date_time_zone');
var_dump($f->getParameters()[0]->getClass()); // cause ReflectionException in PHP 5.5
run `php --rf intltz_from_date_time_zone` =>
Function [ <internal:intl> function intltz_from_date_time_zone ] {
- Parameters [1] {
hax / gist:3982309
Created Oct 30, 2012
modulelint 0.0.2 bug
View gist:3982309
D:\working\hax\mmclass [master]> modulelint -i .
var blackListReg = new RegExp(blackList.join("|"));
SyntaxError: Invalid regular expression: /\doc\|\.git\|\.svn\|\node_modules\/: \
at end of pattern
at new RegExp (unknown source)
at Object.<anonymous> (C:\Users\Administrator\AppData\Roaming\npm\node_modul
hax / gist:3482308
Created Aug 26, 2012
How to create a naked Object in old Browsers (eg. IE 6,7,8) which not support Object.create(null) or {__proto__: null}
View gist:3482308
function nakedObject() {
var iframe = document.createElement('iframe')
iframe.width = iframe.height = 0 = 'none'
iframe.src = 'javascript:'
var proto = iframe.contentWindow.Object.prototype
iframe = null
hax / show_more_groups_for_my_weibo
Created Sep 20, 2011
A bookmarklet to show more group links for the Sina Weibo v4 (Sep, 2011)
View show_more_groups_for_my_weibo
javascript:void function(){STK.sizzle('[node-type="feedGroupLayer"]')[0].style.display='block';STK.sizzle('[node-type="feedGroupLayer"] a[href]')[0].focus()}()
You can’t perform that action at this time.