Skip to content

Instantly share code, notes, and snippets.

View binux's full-sized avatar

Roy Binux binux

View GitHub Profile
@binux
binux / index.html
Last active January 5, 2018 14:51 — forked from anonymous/index.html
JS Bin// source http://jsbin.com/jaqavetema
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<span id="pos"></span>
<canvas id="myCanvas" width="1024" height="728"></canvas>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
</head>
<body>
<script id="jsbin-javascript">
const search = (location.search.match(/q=([^&]+)/) || [null, "1"])[1];
const iframe = document.createElement('iframe');
@binux
binux / bookmark.js
Last active December 21, 2017 15:10
generate css selector for data extraction
javascript:(function (){document.getElementsByTagName('head')[0].appendChild(document.createElement('script')).src='https://gistcdn.githack.com/binux/fb853cd4f4d699d178e66c699b58be68/raw/css_selector_helper.js';}());
@binux
binux / index.html
Last active December 20, 2017 20:40 — forked from anonymous/index.html
JS Bin// source http://jsbin.com/zitojijuda
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<form action="https://book.jetblue.com/B6/webqtrip.html" method=POST>
<button type=submit>submit</submit> <br />
// ==UserScript==
// @name BYR BBS ip2location
// @namespace http://bbs.byr.cn/
// @description 使北邮人论坛用户发贴IP地址后附加物理地址信息
// @include http://forum.byr.edu.cn/*
// @include http://forum.byr.cn/*
// @include http://bbs.byr.edu.cn/*
// @include http://bbs6.byr.edu.cn/*
// @include http://bbs.byr.cn/*
// @include http://bbs6.byr.cn/*
@binux
binux / pinterest.py
Last active December 10, 2016 12:04
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
# vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8:
# Author: Binux<i@binux.me>
# http://binux.me
# Created on 2013-03-02 20:47:08
import os
import re
import sys
@binux
binux / pyspider_bench.py
Last active December 6, 2016 10:33
benchmarking for pyspider. using scrpy==0.24.4 mockserver
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
# vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8:
# Author: Binux<i@binux.me>
# http://binux.me
# Created on 2014-11-17 23:29:30
import os
import sys
import time
@binux
binux / pyproxy.sh
Last active October 27, 2016 09:23
A script to run proxy in docker. `/bin/bash -c "$(wget -q -O - https://gist.github.com/binux/60c3d22070f18bf396a85c43c43fb2bd/pyproxy.sh)" bash --bind=0.0.0.0`
#!/bin/bash
python -c "$(wget -O - https://bootstrap.pypa.io/get-pip.py)"
python -m pip install pyproxy
python -c "from pyproxy import main;main();" $@
@binux
binux / rewrite.py
Created September 7, 2012 04:25
web proxy http links rewrite
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
# vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8:
# Author: Binux<17175297.hk@gmail.com>
# http://binux.me
# Created on 2012-09-06 22:22:21
import urlparse
import re
@binux
binux / baidu_fanyi.py
Created December 8, 2011 07:06
百度翻译api
# -*- encoding: utf-8 -*-
# author: binux<17175297.hk@gmail.com>
import re
import time
import json
import requests
class BaiduFanYiAPI(object):
"""