Skip to content

Instantly share code, notes, and snippets.

bigeagle bigeagle

Block or report user

Report or block bigeagle

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
@bigeagle
bigeagle / mp3_cover.py
Created Feb 6, 2012
fetch album cover from douban
View mp3_cover.py
#!/usr/bin/python2
# -*- encoding:utf8 -*-
import os
import urllib
import urllib2
import time
import re
import eyeD3
import argparse
urlread = lambda url: urllib2.urlopen(url).read()
@bigeagle
bigeagle / dnspodsh.sh
Created Feb 23, 2012 — forked from zrong/dnspodsh.sh
在bash中使用DNSPod的API接口实现DDNS客户端
View dnspodsh.sh
#!/bin/bash
##############################
# dnspodsh
# 基于dnspod api构架的bash ddns客户端
# 作者:zrong(zengrong.net)
# 日期:2012-02-13
##############################
login_email=${1:?'必须提供登录名'}
@bigeagle
bigeagle / dnspod.py
Created Feb 23, 2012
update dns records on dnspod dynamically
View dnspod.py
#!/usr/bin/env python2
# -*- coding:utf8 -*-
# ----------------
# forked from dnspod official client
# modified by Justin Wong <bigeagle(at)xdlinux.info>
# License: MIT
# ----------------
import httplib, urllib
import socket
@bigeagle
bigeagle / dnspod.py
Created Feb 23, 2012
Update dnspod record dynamically
View dnspod.py
#!/usr/bin/env python2
# -*- coding:utf8 -*-
'''
* forked from dnspod's offical python script for dynamic dns record
* modified by Justin Wong <bigeagle(at)xdlinux(dot)info>
* LICENSE: MIT License
'''
import httplib, urllib
@bigeagle
bigeagle / thunet.py
Created Aug 13, 2012
THU net connector via web
View thunet.py
#!/usr/bin/env python2
# -*- coding:utf8 -*-
import requests
import argparse
USERNAME=""
PASSWORD=""
BASE_URL="http://net.tsinghua.edu.cn/"
View gist:3953673
[user]
name = bigeagle
email = justin.w.xd@gmail.com
[color]
diff = auto
status = auto
branch = auto
interactive = auto
[alias]
co = checkout
View gitmanul.md

Git 简要教程

##引言

鉴于使用Git有一点点门槛(比SVN稍微高一点),我写了个实用教程,如果想更进一步了解Git,或者觉得我写的太懶,推荐参考书 Progit,这本书是开源的,前四章就足够用了。

组内我和晓天、汤韬都会使用git,有问题可以线下直接问。

至于为什么要用Git,其实用SVN也是挺好的,但是SVN是集中式提交,同一时刻只能有一个人修改一个文件,这个在很多时候会比较蛋疼,另一方面SVN提交时要求联网,这样碰上断网什么的话SVN就废了。

@bigeagle
bigeagle / block_bad_ip.py
Created Nov 12, 2012
Anti gfw6's dns pollution
View block_bad_ip.py
#!/usr/bin/env python2
# -*- coding:utf-8 -*-
import os
import sys
def ip62hex(ip):
ip = map(lambda x: int(x, 16), ip.split(':'))
hexed = reduce(list.__add__,
[[(x >> 8), (x & 0x00FF)] for x in ip])
View primes.scala
object Main extends App{
def primes(nums: Stream[Int]): Stream[Int] =
Stream.cons(nums.head, primes(nums.tail filter (_ % nums.head > 0)))
val p = primes(Stream.from(2))
println(p apply 201314)
}
View tornado_motor_test.py
#!/usr/bin/env python2
# -*- coding:utf-8 -*-
import tornado.ioloop
import tornado.web
import tornado.gen
import motor
import json
class PersistantHandler(tornado.web.RequestHandler):
You can’t perform that action at this time.