Skip to content

Instantly share code, notes, and snippets.

Zeyi (Rice) Fan fanzeyi

Block or report user

Report or block fanzeyi

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View iterm.diff
diff --git a/autoload/dispatch/iterm.vim b/autoload/dispatch/iterm.vim
index 7b52012..068f95f 100644
--- a/autoload/dispatch/iterm.vim
+++ b/autoload/dispatch/iterm.vim
@@ -21,22 +21,23 @@ function! dispatch#iterm#handle(request) abort
endfunction
function! dispatch#iterm#spawn(command, request, activate) abort
- let script = dispatch#isolate([], dispatch#set_title(a:request), a:command)
+ let script = s:isolate(a:request.command)
View 8.012.c
#include <stdio.h>
void func(char *s, char *t);
int main()
{
char s[] = "time";
int t;
t = 10;
@fanzeyi
fanzeyi / xiami_decode.js
Created Apr 29, 2012 — forked from dndx/xiami_decode.py
Xiami URL Decoder
View xiami_decode.js
function decode(loca) {
var result = [], url = "";
var line, rows, extra;
loca = loca.trim();
if(loca === "") {
return "";
}
line = Number(loca[0]);
rows = Math.floor((loca.length - 1) / line);
extra = (loca.length - 1) % line;
View dns_resolve.py
import os
import re
import socket
import struct
def dns_resolve(host, dnsserver):
assert isinstance(host, basestring) and isinstance(dnsserver, basestring)
index = os.urandom(2)
hoststr = ''.join(chr(len(x))+x for x in host.split('.'))
data = '%s\x01\x00\x00\x01\x00\x00\x00\x00\x00\x00%s\x00\x00\x01\x00\x01' % (index, hoststr)
View rp for spreadsheet
server {
listen 80;
server_name XXXX;
location / {
proxy_redirect off;
proxy_set_header Host "spreadsheets.google.com";
proxy_pass http://spreadsheets.google.com;
proxy_set_header x-real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
You can’t perform that action at this time.