Skip to content

Instantly share code, notes, and snippets.

View dragonly's full-sized avatar
🎯
Focusing

Yilong Li dragonly

🎯
Focusing
View GitHub Profile
#!/usr/bin/env python
#coding=utf8
'''
Created on Mar 18, 2013
@author: yoyzhou
'''
'''
@dragonly
dragonly / gist:1f226d49f356adadee09
Created November 2, 2014 13:28
a weibo follower page
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta content="周鸿祎,周鸿祎的微博,微博,新浪微博,weibo" name="keywords" />
<meta content="周鸿祎,奇虎360董事长。周鸿祎的微博主页、个人资料、相册。新浪微博,随时随地分享身边的新鲜事儿。" name="description" />
<meta name="viewport" content="initial-scale=1,minimum-scale=1" />
<title>周鸿祎的微博_微博</title>
<link type="text/css" rel="stylesheet" charset="utf-8" href="http://img.t.sinajs.cn/t6/style/css/module/base/frame.css?version=c7cf9996704c51aa" putoff="style/css/module/combination/extra.css?version=c7cf9996704c51aa" />
import requests
import xml.etree.ElementTree as ET
import xmltodict
import pprint
import json
url_base = 'http://bbs.fudan.edu.cn/bbs/rss?bid=%s'
board_range = range(1,299)
channels = []
class MyPrettyPrinter(pprint.PrettyPrinter):
def format(self, object, context, maxlevels, level):
if isinstance(object, unicode):
return (object.encode('utf8'), True, False)
return pprint.PrettyPrinter.format(self, object, context, maxlevels, level)
@dragonly
dragonly / rvalue.cpp
Created April 21, 2016 04:41
test rvalue related behaviors of C++11
#include <iostream>
using namespace std;
class Foo
{
public:
Foo() { cout << "Foo::ctor" << endl; }
Foo(Foo &foo) { cout << "Foo:copy" << endl; }
~Foo(){ cout << "Foo::dtor" << endl; }
@dragonly
dragonly / ctags_with_dep.sh
Last active July 23, 2016 11:36 — forked from xuhdev/ctags_with_dep.sh
Generate ctags file for C or C++ files and its depedencies (included header files). This could avoid you to always generate a huge tags file.
#!/bin/bash
function usage() {
echo "Usage:"
echo " ./ctags_with_dep.sh file1.c file2.cpp"
}
CFLAGS="`pkg-config --cflags ImageMagick++ freetype2 fontconfig assimp` -I../Include -IFreetypeGL -I../Common/FreetypeGL"
if [ -n "$1" ]; then
@dragonly
dragonly / pretty git log
Last active June 18, 2021 02:04
git log visualization
# put this in your ~/.gitconfig, then issue `git lg` will get you a pretty git branch topology view
#
# this is just a start point, customizations can be done by further fine tuning referencing
# https://git-scm.com/docs/git-log & https://git-scm.com/docs/pretty-formats
#
# --graph draws the git commits tree
# --date=local is used in the following --format
#
# format explanation:
# %C(colorname)xxx%C(reset) encloses text `xxx` with color `colorname`
@dragonly
dragonly / zshrc
Last active January 28, 2018 09:15
~/.zshrc with oh-my-zsh
export EDITOR=vim
export LC_ALL=en_US.UTF-8
export TERM=xterm-256color
# add timestamp to the right
export RPROMPT="%{$fg_bold[green]%}%D{%m-%f} %*%{$reset_color%}"
@dragonly
dragonly / vimrc
Created January 28, 2018 08:59
in addition to amix/vimrc
let g:go_version_warning = 0
let g:syntastic_check_on_wq = 0
# let g:syntastic_c_include_dirs = ["/usr/local/cuda/include"]
let g:NERDTreeWinPos = "left"
let g:NERDTreeWinSize = 20
let g:syntastic_loc_list_height = 5
set nu
set tabstop=2
set shiftwidth=2
set expandtab
@dragonly
dragonly / tricky_chrome_debugger.html
Last active July 14, 2018 05:13
tricky chrome debugger
<html>
<body>
Just open the chrome debugger and see wierd things
<script>
let x = {
x: {
x: 1
}
}
console.log(x.x.x)