I hereby claim:
- I am blankyao on github.
 - I am blankyao (https://keybase.io/blankyao) on keybase.
 - I have a public key ASAdIcPHym9drp9AG9Y2BpTTx3Lbc41UrdHJ7yT3JbWwNAo
 
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| (function(global){ | |
| var i = document.createElement('iframe'); | |
| document.body.appendChild(i); | |
| for(var k in global) { | |
| if(!(k in i.contentWindow)) { | |
| console.log(k); | |
| } | |
| } | |
| document.body.removeChild(i); | |
| })(window); | 
| #! /bin/bash | |
| # Set the default policies to allow everything while we set up new rules. | |
| # Prevents cutting yourself off when running from remote SSH. | |
| iptables -P INPUT ACCEPT | |
| iptables -P FORWARD ACCEPT | |
| iptables -P OUTPUT ACCEPT | |
| # Flush any existing rules, leaving just the defaults | |
| iptables -F | 
| // | |
| // PSPDFThreadSafeMutableDictionary.m | |
| // | |
| // Copyright (c) 2013 Peter Steinberger, PSPDFKit GmbH. All rights reserved. | |
| // | |
| // 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 | 
| struct hostent *host = gethostbyname(@"localhost".UTF8String); | |
| char addr[32]; | |
| inet_ntop(host->h_addrtype, host->h_addr, addr, sizeof(addr)); | |
| NSString *result=[[NSString alloc] initWithUTF8String:addr]; | 
| # -*- coding:utf-8 -*- | |
| '写了一个简单的支持中文的正向最大匹配的机械分词,其它不用解释了,就几十行代码' | |
| '搜狗词库下载地址:http://vdisk.weibo.com/s/7RlE5' | |
| import string | |
| __dict = {} | |
| def load_dict(dict_file='words.dic'): | |
| '加载词库,把词库加载成一个key为首字符,value为相关词的列表的字典' | 
| #pragma - | |
| #pragma UITextViewDelegate | |
| - (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text | |
| { | |
| if (range.length != 1 && [text isEqualToString:@"\n"]) {//按下return键 | |
| //TODO 做你想做的 | |
| return NO; | |
| } else { | |
| return YES; | |
| } | 
| /* | |
| bindWithDelay jQuery plugin | |
| Author: Brian Grinstead | |
| MIT license: http://www.opensource.org/licenses/mit-license.php | |
| http://github.com/bgrins/bindWithDelay | |
| http://briangrinstead.com/files/bindWithDelay | |
| Usage: | 
| //from http://javascriptweblog.wordpress.com/2010/05/17/partial-currys-flashy-cousin/ | |
| window.___ = {}; //argument placeholder | |
| Function.prototype.partial = function() { | |
| if (arguments.length<1) { | |
| return this; //nothing to pre-assign - return the function as is | |
| } | |
| var __method = this; | |
| var args = arguments; | 
| static unsigned int nextpow2(unsigned int num) { | |
| --num; | |
| num |= num >> 1; | |
| num |= num >> 2; | |
| num |= num >> 4; | |
| num |= num >> 8; | |
| num |= num >> 16; | |
| return ++num; | |
| } |