Skip to content

Instantly share code, notes, and snippets.

View liamzh's full-sized avatar

Liam Z liamzh

View GitHub Profile
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<style>
</style>
</head>
<body>
@liamzh
liamzh / batch_block.js
Last active August 29, 2015 14:28
批量拉黑给知乎某个回答点赞的同学
if ((/http\:\/\/www\.zhihu\.com\/question\/(.+)\/answer\/(.+)/.exec(location.href)) !== null) {
var anwerId = $(".zg-anchor-hidden")[0].name.split("-")[1];
var votersProfile = "http://www.zhihu.com/answer/" + anwerId + "/voters_profile";
$.get(votersProfile)
.done(function(data) {
var a = data.payload;
for (var i=0; i < a.length; i++) {
var usrName = $(a[i]).find("a").attr("href").split("/")[2];
console.log("给 " + usrName + " 执行死刑");
$.post("http://www.zhihu.com/people/" + usrName + "/block", { action: "add" });
@liamzh
liamzh / gist:7209711
Last active December 26, 2015 20:38 — forked from bkimble/gist:1365005
#!/usr/bin/env ruby
# List all keys stored in memcache.
# Credit to Graham King at http://www.darkcoding.net/software/memcached-list-all-keys/ for the original article on how to get the data from memcache in the first place.
require 'net/telnet'
headings = %w(id expires bytes cache_key cache_value)
rows = []
@liamzh
liamzh / gist:5449825
Created April 24, 2013 05:25
「按键问题」解题报告

「按键问题」解题报告

作者:TheLover_Z

问题描述:

假设你的键盘只有以下键:A,Ctrl + A,Ctrl + C,Ctrl + V。

这里 Ctrl+A,Ctrl+C,Ctrl+V 分别代表「全选」,「复制」,「粘贴」,组合键算一次按键。

@liamzh
liamzh / fanfou.py
Created February 28, 2013 14:25
fanfou oauth
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import oauth2 as oauth
import urllib
class fanfou():
def __init__(self, consumer_key, consumer_secret, oauth_token, oauth_token_secret):
self.consumer_key = consumer_key