• sublime 的 Snippets 可以自定义代码补全功能。
1. 我建了一个python的main方法自动提示,步骤如下:

    1.  (Tools > new Snippet) 

            <!-- See http://www.sublimetext.com/docs/snippets for more information -->
            <snippet>
                <tabTrigger>main_song</tabTrigger>
                <scope>source.python</scope>
                <description>main</description>
                <content><![CDATA[
            if __name__ == '__main__' :
                ${0:pass}
            ]]></content>
            </snippet>

    2.  保存为文件名 main.sublime-snippet。默认保存到package文件下。这样升级的时候不会覆盖掉。

参考以下链接:

Sublime Text 2 使用配置心得 – notepad++ 略丑

Sublime Text 2配置和使用

为win7创建软连接: 命令格式为: mklink source origin ,即在桌面创建一个指向 c:\Users\song\octopress\ source\_posts 的超链接。

C:\Users\song>mklink /d   C:\Users\song\Desktop\_postse c:\Users\song\octopress\
source\_posts

http://sinosmond.github.com/blog/2012/06/24/centos6-dot-2-plus-jdk6-plus-tomcat7-plus-nginx1-dot-2-plus-mysql5-dot-x/


  • 我用的django的版本是1.3,听闻django可以配置日志模块,不用自己单独写,于是一阵狂搜加看官方文档解决了我的需求。

  • 我的需求是需要配置多个日志文件,网上搜出来大部分是一个的,所以给大家一个我的例子做参考。

  1. 在setting.py里面配置如下:

    LOGGING = {
        'version': 1,
        'disable_existing_loggers': True,
        'formatters': {
            'standard': {
                    'format': '%(levelname)s %(asctime)s %(message)s'
                    },
        },
        'filters': {
        },
        'handlers': {
            'mail_admins': {
                'level': 'ERROR',
                'class': 'django.utils.log.AdminEmailHandler',
                'formatter':'standard',
            },
            'test1_handler': {
                'level':'DEBUG',
                'class':'logging.handlers.RotatingFileHandler',
                'filename':'path1',
                'formatter':'standard',
            },
            'test2_handler': {
                'level':'DEBUG',
                       'class':'logging.handlers.RotatingFileHandler',
                'filename':'path2',
                'formatter':'standard',
            },
        },
        'loggers': {
            'django.request': {
                'handlers': ['mail_admins'],
                'level': 'ERROR',
                'propagate': True,
            },
            'test1':{
                'handlers': ['test1_handler'],
                'level': 'INFO',
                'propagate': False
            },
             'test2':{
                'handlers': ['test2_handler'],
                'level': 'INFO',
                              'propagate': False
            },
        }
    }

  1. 里面的level什么的可以自己调整,需要几个文件就配几个handler和logger,还是很方面的。用的时候怎么用呢,看下面吧。
  2. 在要用log的view.py里面,如果想用test1这个日志,则:
log=logging.getLogger('test1')
log.error(“日志内容”) 
  1. 如果,想要在日志内容里面传递变量,怎么办:

     log.error(" %s : execute %s failed",变量1,变量2),比较像c的printf,还是很方便的
    

Here be a sample post with a custom background image. To utilize this “feature” just add the following YAML to a post’s front matter.

image:
  background: filename.png

This little bit of YAML makes the assumption that your background image asset is in the /images folder. If you place it somewhere else or are hotlinking from the web, just include the full http(s):// URL. Either way you should have a background image that is tiled.

If you want to set a background image for the entire site just add background: filename.png to your _config.yml and BOOM — background images on every page!

song

Background images from Subtle Patterns (Subtle Patterns) / CC BY-SA 3.0