Skip to content

Instantly share code, notes, and snippets.

View muzizongheng's full-sized avatar

muzizongheng(李建功) muzizongheng

View GitHub Profile
using System;
using System.Net.Http;
using Extensibility;
using EnvDTE;
using EnvDTE80;
using Microsoft.VisualStudio.CommandBars;
using System.Resources;
using System.Reflection;
using System.Globalization;
private DTE2 _applicationObject;
private AddIn _addInInstance;
private string _githubClientId = @"d15081f5f72ba1075e40";
private string _githubClientSecret = @"68d71642fc2b8872cfa1b2358f03289dbfd656a4";
private string _githubScopes = @"gist";
@muzizongheng
muzizongheng / myFirstCodeSnippet
Created June 19, 2013 06:16
my first code snippet
public myFirstCodeSnippet
{
string Test {get; set;}
}
@muzizongheng
muzizongheng / EDAMTest_GetNotes.py
Created June 25, 2013 08:09
use evernote api to get every note(include: tilte, content, resource)
# List all of the notebooks in the user's account
notebooks = noteStore.listNotebooks(authToken)
print("Found ", len(notebooks), " notebooks:")
for notebook in notebooks:
print(" * ", notebook.name)
filter = NoteStore.NoteFilter()
filter.notebookGuid = notebook.guid
noteList = noteStore.findNotes(authToken, filter, 0, 50)
@muzizongheng
muzizongheng / EDAMTest2.py
Created June 27, 2013 01:07
open file by utf-8
f = open(n.title+".html", "w+", encoding='utf-8-sig')
f.write(content)
f.close()
import string
from datetime import datetime
from flask import url_for
from flask.ext.xmlrpc import XMLRPCHandler, Fault
from labs import app, db
from labs.models import User, Post, Tag, Category
# MetaWeblogAPI XML-RPC
handler = XMLRPCHandler('api')
handler.connect(app, '/api')
#!/usr/bin/python
""""
Copyright 2008 Ritesh Nadhani. All Rights Reserved.
For license information please check the LICENSE page of the package.
"""
#!/usr/bin/python
import cgi, cgitb
# Uncomment this to view errors
# cgitb.enable()
import urlparse
import urllib
import sys
import oauth2 as oauth
@muzizongheng
muzizongheng / AccessEN.py
Created July 1, 2013 06:39
convert evernote's tags to blog's categories
#create blog category by tags
tagslist = noteStore.listTagsByNotebook(authToken, notebook.guid)
categories = convertTags2Category(tagslist)
try:
for c in categories:
metaweblog.new_category(c)
except Exception as err:
print("Create category failed: ", err)
finally:
@muzizongheng
muzizongheng / AccessCSDN.py
Created July 18, 2013 06:04
read dict string and convert string to dict object
data = r.read().decode('utf-8')
reader = json.JSONDecoder()
responseData = reader.decode(data)
return responseData['data']