Skip to content

Instantly share code, notes, and snippets.

View tpai's full-sized avatar
💭
kumo

tonypai tpai

💭
kumo
View GitHub Profile
@tpai
tpai / file_get_contents.php
Created September 25, 2014 17:57
file_get_contents.php
<?php
header("Access-Control-Allow-Origin: *");
$opts = array('http'=>array('header' => "User-Agent:MyAgent/1.0\r\n"));
$context = stream_context_create($opts);
echo file_get_contents($_GET['url'], false, $context);
?>
@tpai
tpai / file_get_contents_accept_cookie.php
Created September 25, 2014 17:57
file_get_contents_accept_cookie.php
@tpai
tpai / fetch-xunlei-urls.js
Last active August 29, 2015 14:07
fetch-xunlei-urls
// You should browse the URL which is like "http://kuai.xunlei.com/d/xxxxxxxxxxx" with jquery library.
var url = ""
$.each($("#file-list").find("a"), function(key, val) {
url += $(val).attr("href")+"<br />"
})
window.open("data:text/html,<title>Select All Then Copy</title>"+url)
@tpai
tpai / eyny-image-packer.js
Last active August 29, 2015 14:08
eyny-image-packer
if (location.hostname.search("eyny.com") != -1) {
var data = "";
var img_arr = new Array;
img_arr = document.getElementsByClassName("pcb")[0].getElementsByTagName("img");
var view = prompt("[1]HTML(網頁)[2]Links(連結)", "");
for (var i = 0; i < img_arr.length; i++) {
if (view == 1) {
data += "<img src='" + img_arr[i].getAttribute("src") + "' width='" + img_arr[i].getAttribute("width") + "' /><br />\n"
} else if (view == 2) {
data += img_arr[i].getAttribute("src") + "\r\n"
@tpai
tpai / 8comic.js
Created November 4, 2014 17:00
8comic-image-src
// http://new.comicvip.com/show/cool-103.html?ch=765-17
// http://new.comicvip.com/show/cool-[ti].html?ch=[ch]-[p]
function send() {
cs = document.getElementById("cs").innerHTML;
ti = document.getElementById("ti").value;
ch = document.getElementById("ch").value;
p = document.getElementById("p").value;
sp();
}
@tpai
tpai / startup.js
Last active August 29, 2015 14:08
14行js code告訴你創業家的行為模式 XD
創業 = function(創始人, 點子, 資金) {
while (資金 > 0) {
創始人[開發人猿].寫程式(咖啡, 泡麵);
創始人[市場開發].到處找(有錢的親戚朋友);
創始人[產品企劃].檢驗點子(潮鞋, 便利貼);
if(被Google併購) {
return 資金 * 1000;
} else {
資金--;
點子.轉向();
@tpai
tpai / package.json
Last active November 2, 2020 13:50
A web crawler sample based on nightwatch.
{
"name": "nightwatch_webcrawler",
"description": "A web crawler sample based on nightwatch.",
"version": "0.0.1",
"author": {
"name": "tonypai",
"email": "[email protected]"
},
"homepage": "http://github.com/tpai",
"dependencies": {
@tpai
tpai / index.html
Last active June 17, 2019 15:46
jquery cdn speed race
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>jQuery CDN Speed Race by jQuery async ajax</title>
</head>
<body>
<center><h1>jQuery CDN Speed Race by jQuery async ajax</h1></center>
<h2>Test Subjects</h2>
<pre id="list"></pre>
@tpai
tpai / ep1.md
Last active August 29, 2015 14:10
mu complex - awesome puzzle game in kongregate (http://www.kongregate.com/games/StudioCime)
  • half0099way
  • 1littleduck
  • iamLYA
  • admiral
  • harps
  • mapleton
  • nonsense
  • science
  • deadbeef
  • way
@tpai
tpai / instructions.md
Last active September 22, 2022 11:20
use both Tor and Privoxy with Mac OSX

1. install

brew install tor
brew install privoxy

2. copy and modify config file