This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>d3.tip.js - Tooltips for D3</title> | |
| <meta charset="utf-8" /> | |
| <title>Bar Chart</title> | |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js" charset="utf-8"></script> | |
| <script type="text/javascript" src="../index.js"></script> | |
| <script type="text/javascript"> | |
| data = [{"total":1225, "date": "5.1"},{"total":279, "date": "5.2"},{"total":212, "date": "5.3"},{"total":335, "date": "5.4"},{"total":329, "date": "5.5"},{"total":234, "date": "5.6"},{"total":175, "date": "5.7"}, {"total":1225, "date": "5.1"},{"total":279, "date": "5.2"},{"total":212, "date": "5.3"},{"total":335, "date": "5.4"},{"total":329, "date": "5.5"},{"total":234, "date": "5.6"},{"total":175, "date": "5.7"}, {"total":1225, "date": "5.1"},{"total":279, "date": "5.2"},{"total":212, "date": "5.3"},{"total":335, "date": "5.4"},{"total":329, "date": "5.5"},{"total":234, "date": "5.6"},{"total":175, "date": "5.7"}, {"total":1225, "date": "5.1"},{"total":279, "date": "5.2"},{"total":212, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public Bitmap Draw(Color subjectCol, string subjectStr, Color statusCol, string statusStr) { | |
| var fullHeight = 0; | |
| var fullWidth = 0; | |
| var padding = 8; | |
| var shadowOffset = 5; | |
| var font = new Font("Segoe UI", 100, GraphicsUnit.Pixel); | |
| var maxWidth = (subjectStr.Length + statusStr.Length) * 100 + 4 * padding; | |
| Bitmap bitmap = new Bitmap(maxWidth, 200); | |
| using (Graphics g = Graphics.FromImage(bitmap)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Text; | |
| using System.Threading.Tasks; | |
| namespace MinLength | |
| { | |
| class Program | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Windows Registry Editor Version 5.00 | |
| [HKEY_CLASSES_ROOT\xm] | |
| @="URL:xm Protocol" | |
| "URL Protocol"="" | |
| [HKEY_CLASSES_ROOT\xm\shell] | |
| [HKEY_CLASSES_ROOT\xm\shell\open] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from bs4 import BeautifulSoup | |
| import urllib2 | |
| url = 'https://path.com/developers/docs' | |
| data = urllib2.urlopen(url).read() | |
| soup = BeautifulSoup(data) | |
| for node in soup.findAll(attrs={'class': 'curl'}): | |
| print node.contents[0] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import feedparser | |
| rss_url = "" | |
| feed = feedparser.parse( rss_url ) | |
| items = feed["items"] | |
| for item in items: | |
| time = item[ "published_parsed" ] | |
| title = item[ "title" ].encode('gb18030') | |
| fileName = str(time.tm_year) + '-' + str(time.tm_mon) + '-' + str(time.tm_mday) + '-' + title + '.md' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import urllib2 | |
| import urllib | |
| import json | |
| import ConfigParser | |
| COMMENTS_SHOW = 'https://api.weibo.com/2/comments/show.json' | |
| USER_TIMELINE = 'https://api.weibo.com/2/statuses/user_timeline.json' | |
| HDR = {'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.64 Safari/537.11', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| sudo apt-get install git | |
| git clone https://github.com/njukidreborn/vimbackup.git ~/.vim | |
| git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle | |
| ln -s ~/.vim/vimrc ~/.vimrc | |
| ln -s ~/.vim/gvimrc ~/.gvimrc |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import sys | |
| import string | |
| def NameToNo(name): | |
| result = 0 | |
| for ch in name.upper().strip("\n"): | |
| result = result * 26 + ord(ch) - ord('A') + 1 | |
| return result | |
| def NoToName(no): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Diagnostics; | |
| using System.Text; | |
| namespace Common | |
| { | |
| /// <summary> | |
| /// This class will take down the steps in the api flow, and trace it if the latency is larger than config. | |
| /// </summary> | |
| public static class PerfTracer |