/tornadodev

tornadodev

Primary LanguageCSS

tornado web

source

Ylab/tornadev

requie

  • tornado >= 3.1
  • python >= 2.7
  • pymongo >= 2.7.1
  • pyjade >= 2.2.0
  • supervisord >= 3.0

code

less but readable

virtualenv(wrapper)

tutorial virtualfish pythonz pythonbrew

auto switch python environment

  source /usr/local/bin/virtualenvwrapper.sh
  mkvirtualenv --no-site-packages --distribute -p /usr/local/bin/python3 tornadev
  pip install -r requirements.txt
#!/bin/bash
  VENV=$1
  if [ -z $VENV ]; then
      echo "usage: runinenv [virtualenv_path] CMDS"
      exit 1
  fi
  . ${VENV}/bin/activate
  shift 1
  echo "Executing $@ in ${VENV}"
  exec "$@"
  deactivate
  # /etc/supervisord.conf
  [program:app]
  command=sh path/to/run.sh ./.venv python boot.py
  directory=/path/to/Project
  autostart=true
  autorestart=true
  startsecs=10

mongodb

tutorial

  • schemeless
  • bson

javascript

  # Assignment:
  number   = 42
  opposite = true

  # Conditions:
  number = -42 if opposite

  # Functions:
  square = (x) -> x - x

  # Arrays:
  list = [1, 2, 3, 4, 5]

source-map

oocss

  • lesscss.org
  • sacss, compass
  select {
    foo1: bar1;
  }
  select sub { 
    foo2: bar2;
  }
  select {
    foo1: bar1;
    sub {
      foo2: bar2;
    }
  }

template

  !!! 5
  html(class=html_cls(__name__))
    head
      meta(chaset='utf-8')
      meta(name="viewport", content="width=device-width, initial-scale=1.0")
      link(rel="stylesheet", type="text/css", href=static_url('build/build.css'))
      link(rel="stylesheet", type="text/css", href=static_url('pure-min.css'))
      link(rel="stylesheet", type="text/css", href=static_url('pure.css'))
      script(type="text/javascript", src=static_url("build/build.js"))
    body
      .pure-g-r#layout
        header.pure-u#menu
          .pure-menu.pure-menu-open
            a.pure-menu-heading(href="/")= _('Dashboard')
            ul
              each name in ['issue', 'index', 'article', 'analyze']
                li
                  a(href="/"+name+"/", class=name)= name

          - var user = handler.current_user
          if user
            p= user.split('@')[0]
            a(href="/auth/logout")= 'Sign Out'

        div.pure-u#main
          block content

tmux

tutorial

  • more than screen
  • split panel
  • session
  • vi/emacs keybind
  • copy/paste buffer (mouse support)

vim

  Bundle 'gmarik/vundle'
  Bundle 'scrooloose/syntastic'
  Bundle 'majutsushi/tagbar'

  Bundle "groenewege/vim-less"
  Bundle "wavded/vim-stylus"
  Bundle "kchmck/vim-coffee-script"
  Bundle 'jade.vim'

  au bufwritepost *.less silent execute '!lessc % > %:t:r.css'
  au bufwritepost *.styl silent execute '!stylus --compress < % > %:t:r.css'
  au bufwritepost *.coffee silent execute '!coffee -cm %'

linux container

vagrant

  vagrant init precise32 http://files.vagrantup.com/precise32.box
  vagrant up
  vagrant ssh

docker

<iframe width="720" height="350" src="http://ascii.io/a/2573/raw" frameborder="0" scrolling="no"></iframe>

subscribe