Skip to content

Instantly share code, notes, and snippets.

View xfoxfu's full-sized avatar

Yuze Fu xfoxfu

View GitHub Profile
@xfoxfu
xfoxfu / book.js
Created June 29, 2017 09:41
Get Book Info in .csv by ISBN and Douban API
"use strict";
exports.__esModule = true;
var request = require("request-promise");
var isbns = process.argv[2].split(",");
for (var _i = 0, isbns_1 = isbns; _i < isbns_1.length; _i++) {
var isbn = isbns_1[_i];
request("https://api.douban.com/v2/book/isbn/" + isbn, {
json: true
})
.then(function (result) {
@xfoxfu
xfoxfu / keybase.md
Last active December 28, 2019 16:47
keybase.md

Keybase proof

I hereby claim:

  • I am xfoxfu on github.
  • I am coderfox (https://keybase.io/coderfox) on keybase.
  • I have a public key whose fingerprint is 2F42 D14C 5512 1BE7 31E6 818D 4788 1526 E6A5 F291

To claim this, I am signing this object:

@xfoxfu
xfoxfu / myYAWFconfig.yawf
Created July 28, 2014 14:21
我的YAWF配置
{
"ua": "Mozilla/5.0 (Windows NT 6.3; rv:30.0) Gecko/20100101 Firefox/30.0",
"yawf": "Yet Another Weibo Filter",
"ver": "0.1.19 alpha",
"gm": "2.1",
"conf": {
"weibo.filters.keyword.whitelist": [],
"weibo.filters.keyword.blacklist": [],
"weibo.filters.keyword.foldlist": [],
"weibo.filters.regexp.whitelist": [],
@xfoxfu
xfoxfu / anti-xp.js
Last active August 29, 2015 13:56
Anti XP JavaScript ( ** DO NOT USE IN PRODUCTION ENV !!! ** )
var sUserAgent = navigator.userAgent;
if (sUserAgent.indexOf("Windows NT 5.1") > -1
|| sUserAgent.indexOf("Windows Xp") > -1) {
alert("你仍然在使用落后的Windows XP操作系统,在你升级操作系统前将不能打开此页面。如果你认为识别有误,请联系管理员。");
window.opener = null;
window.open('', '_self');
window.close();
}
@xfoxfu
xfoxfu / anti-xp-2.php
Last active October 1, 2015 01:11
Anti XP PHP Script ( Without Need of `browscap.ini` )
<?php
/**
* Anti-XP Script
*
* @author 小傅Fox[<xfox@cotr.me>]
*/
/**
* 获得客户端的操作系统
* Source:{@link http://lok.me/a/1027.html}
*
@xfoxfu
xfoxfu / anti-xp.php
Created February 27, 2014 11:52
Anti XP PHP Script
<?php
/**
* Anti-XP Script
*
* @author 小傅Fox[<xfox@cotr.me>]
*/
$anti_xp__browser = get_browser();
if( $anti_xp__browser[ 'platform' ] == 'WinXP' ){
if( $_SERVER[ 'HTTP_ACCEPT_LANGUAGE' ] == 'zh-CN' ){
@xfoxfu
xfoxfu / func.php
Created February 25, 2014 12:21
新浪微博用户名-密码获取token PHP
<?php
/**
* Get Token
*
* @return Access Token
* @throws Exception
*/
function SWAP( $username , $password , $app_key , $redirect_uri )
{
$username = urlencode( $username );
@xfoxfu
xfoxfu / echo.py
Created January 22, 2014 13:29
get image text
import Image
color = 'MNHQ$OC?7>!:-;.'
def to_html(func):
html_head = '''
<html>
<head>
<style type="text/css">
body {font-family:Monospace; font-size:5px;}