Atom快捷键

文件切换

ctrl-shift-s 保存所有打开的文件
cmd-shift-o 打开目录
cmd-\ 显示或隐藏目录树
ctrl-0 焦点移到目录树

cmd-tcmd-p 查找文件
cmd-b 在打开的文件之间切换
cmd-shift-b 只搜索从上次git commit后修改或者新增的文件

导航

（等价于上下左右）
ctrl-p 前一行
ctrl-n 后一行
ctrl-f 前一个字符
ctrl-b 后一个字符

alt-B, alt-left 移动到单词开始
alt-F, alt-right 移动到单词末尾

cmd-right, ctrl-E 移动到一行结束
cmd-left, ctrl-A 移动到一行开始

cmd-up 移动到文件开始
cmd-down 移动到文件结束

ctrl-g 移动到指定行 row:column 处

cmd-r 在方法之间跳转

程序员如何提高影响力?

如何提高影响力，为自己代言

• 博客
• Github
• StackOverflow(or SegmentFault, Zhihu)

搭建一个跨平台的平台

So，在开始的时候我们需要有一个统一的ID，来标识我们的身份:我是谁，你在xx网站上看到的那个xx就是我。刚开始的时候，我在CSDN、Github上的ID(gmszone)和我的博客的域名(Phodal)是不一样的，因为当时的域名(gmszone.com)握在别人的手上，于是我便想办法将两个ID改了过来（ps: github提供迁移)。后来，Phodal就成了我的发声平台:

Tornado 作为一个 Python 的异步非阻塞服务器与轻量级 Web 框架, 相当令人着迷. 为了体验一把 OAuth2.0 认证, 我用 Tornado 搭建了一个网站, 调用新浪微博 API. 新浪微博的 OAuth2.0 认证的顺序如下:

• 用户访问客户端, 客户端把用户带到新浪认证服务器去输用户名密码;
• 新浪认证服务器认证完毕后, 将用户带到客户端某指定页面, 给这个页面传递一个 GET 参数 code;
• 客户端某指定页面接收到 code 之后, 后台发起对新浪API服务器的POST请求, 用 code 换取 access_token;
• 得到 access_token 后, 就可以用来调用各种需要用户登录之后才能调用的 API 了.

不要在setting中import太多东西

One of our production Django sites broke this afternoon with a database error “relation xyz doesn’t exist”. So: a missing table.

Why 1

I helped debugging it and eventually found the cause by doing a select * from south_migrationhistory. This lists the south migrations and lo and behold, a migration had just been applied 25 minutes earlier. The migration name suggested a rename of tables, which of course matches the “missing table” error.

Why 2

Well, someone was working on a bit of database cleanup and refactoring. Naming consistency, proper use of permissions, that sort of thing. Of course, locally in a branch. And on a development database. Now why did the local command result in a migration on the production database?

Why 3

So, effectively, “why don’t the development settings work as intended”? We normally use settings.py as the production settings and a developmentsettings.py that is used in development. It imports from settings.py and sets the debug mode and development database and so.

This project is a bit different in that there’s only a settings.py. It does however try to import localsettings.py. This is generated for you when you set up your project environment with ansible. A bit less clear (in my opinion) than a real .py file in your github repository, but it works. We saw the generated localsettings file with development database and DEBUG = True. This wasn’t the cause. What then?

Normally, calling django’s diffsettings command (see the django documentation) shows you any settings errors by printing all the settings in your config that are different from Django’s defaults. In this case, nothing was wrong. The DATABASES setting was the right one with the local development database. Huh?

The developer mentioned one other thing he changed recently: importing some django signal registration module in the settings.py. Ah! Django’s signals often work on the database. Yes, the signals in this module did database work, too.

So the settings.py effectively looked like this:

The import of the signal registration module apparently triggered something in Django’s database layer so that the database connection was already active. The subsequent change of the DATABASES config to the local development database didn’t have any effect anymore.

diffsettings just shows you what the settings are and doesn’t catch the fact that the DATABASES isn’t really used in the form that comes out of diffsettings.

ECMAScript 6 Features 中文版

Introduction 简介

ECMAScript 6 is the upcoming version of the ECMAScript standard. This standard is targeting ratification in June 2015. ES6 is a significant update to the language, and the first update to the language since ES5 was standardized in 2009. Implementation of these features in major JavaScript engines is underway now.

ECMAScript 6 是 ECMAScript 的下一代标准，预计将在 2015年6月 正式发布。ES6 的发布将是是这门语言自 2009 年 ES5 正式发布以来的首次更新，是一次富有意义的更新。Javascript核心引擎的新特性仍然在快速开发中。

See the draft ES6 standard for full specification of the ECMAScript 6 language.

ES6 includes the following new features:

python lambda教程

When I first started learning Python, one of the most confusing concepts to get my head around was the lambda statement. I’m sure other new programmers get confused by it as well…

Mike的讨论非常好：清晰, 直接, 有实用的示例. 它帮助我终于领会了lambda, 并导致我写的另一篇lambda教程.

lambda：一个用来构造函数的工具

Python and Flask Are Ridiculously Powerful

As a developer, I sometimes forget the power I wield. It’s easy to forget that, when something doesn’t work the way I’d like, I have the power to change it. Yesterday, I was reminded of this fact as I finally got fed up with the way payments are processed for my book. After being unhappy with the three different digital-goods payment processors I’ve used since the book came out, I took two hours and wrote my own solution using Python and Flask. That’s right. Two hours. It’s now powering my book payment processing and the flow is so incredibly simple that you can buy the book and begin reading it in 20 seconds.

Read on to find out how I created my own digital goods payment solution in an evening.

A Better Way to Learn AngularJS

Introduction

Congratulations on taking the plunge!

This AngularJS course is built with the intent of exposing you to the best available resources on each Angular topic. Our desire is to present these topics richly, and from a variety of vantage points, in order to afford you a more complete perspective on them.

This course is accompanied by AngularJS Tutorial: Learn to Build Modern Web Apps with MEAN.

The learning curve of AngularJS can be described as a hockey stick. Getting started with apps featuring basic functionality is delightfully easy. However, building more complex apps often require understanding Angular’s inner workings. Failure to do so will cause development to become awkward and cumbersome.

With AngularJS, the “Ready, Fire, Aim” learning methodology of duct taping together a handful of tutorials and a cursory glance through the documentation will lead to confusion and frustration. This curriculum is designed to properly guide you through each of the key Angular concepts thoroughly with a broad exposure to high quality content. With your eventual mastery of AngularJS, you will be able to fluently and efficiently construct large-scale applications.

Prerequisites

• Moderate knowledge of HTML, CSS, and JavaScript
• Basic Model-View-Controller (MVC) concepts
• The Document Object Model (DOM)
• JavaScript functions, events, and error handling

Resources

Since AngularJS is still in its infancy relative to other JavaScript frameworks, the number of encyclopaedic resources on it is still insufficient. Therefore, the curriculum will employ a healthy number of excellent blogs in order to offer a more meaty perspective on respective topics.

• Required Resources
• AngularJS - O’Reilly Media (available on Amazon)
• AngularJS docs
• Supplemental Resources
• OneHungryMind
• year of moo
• Bruno Scopelliti blog

Part 1. Kicking the Tires

AngularJS is not a library.

Rather, it is a JavaScript framework that embraces extending HTML into a more expressive and readable format. It allows you to decorate your HTML with special markup that synchronizes with your JavaScript leaving you to write your application logic instead of manually updating views. Whether you’re looking to augment existing JavaScript applications or harness the full power of the framework to create rich and interactive SPA’s, Angular can help you write cleaner and more efficient code.
Filling the Tank

We’ve found that the egghead.io videos are the best starting resource available, so every chapter will lead off with them. The transcribed screencasts and source code are provided along with the videos. We encourage you to follow along with them, as they make the video content much more readily digestible.

As good as the egghead videos are, they should serve only as an introductory resource. Excerpts from the O’Reilly AngularJS book and the angularjs.org documentation complement the videos as the broader and more thorough source, and should be treated as the main reference for the course.

When descending upon an entirely new topic, it is important to frame the topic correctly before diving into the minutia.

Read the following two entries in the AngularJS guide docs, they will give you a good idea of what you’re about to get into. Don’t worry about picking up on every aspect of the topics they glaze over, all of these will be covered thoroughly in subsequent lessons.

AngularJS Overview

Introduction to AngularJS
Revving the Engine

Before we get on with it, we recommend this post:

Things I Wish I Were Told About Angular.js

It goes over a handful of topics that might be helpful in building the appropriate mental models while consuming the Angular curriculum. Some, probably most, of the terms will bounce right off you until you have gone through that section of the course, but it should provide valuable context when approaching a new topic.

Now it’s off to the races!

AngularJS相关工具

AngularJS 是一组用来开发Web页面的框架、模板以及数据绑定和丰富UI组件。它支持整个开发进程，提供web应用的架构，无需进行手工DOM操作。 AngularJS很小，只有60K，兼容主流浏览器，与 jQuery 配合良好。