Install system dependencies:
- Note I have a lot of c libraries already installed from Python development
- cmake
- leptonica
Dir setup:
| def integer_first?(x) | |
| !!/^\d/.match(x) | |
| end |
| html { | |
| font-family: "Dejavu Sans Mono", "Monaco", monospace; | |
| font-size: 9pt; | |
| background-color: #202020; | |
| color: #FFFFFF; | |
| padding: 0; | |
| margin: 0; | |
| } | |
| body { |
Install system dependencies:
Dir setup:
| class DynamicSingletonMethods | |
| def method_missing(meth,*args,&block) | |
| method_string = meth.to_s | |
| if method_string.end_with? '=' | |
| method = method_string.split('=')[0] | |
| self.define_singleton_method(method.to_sym) do args[0] end | |
| else | |
| super | |
| end |
| local ret_status="%(?:%{$fg_bold[green]%}➜ :%{$fg_bold[red]%}➜ %s)" | |
| PROMPT='${ret_status}%{$fg_bold[green]%}%p$(rvm_gemset)%{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}' | |
| ZSH_THEME_GIT_PROMPT_PREFIX="git:(%{$fg[red]%}" | |
| ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" | |
| ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}) %{$fg[yellow]%}✗%{$reset_color%}" | |
| ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%})" | |
| # Determine if we are using a gemset. | |
| function rvm_gemset() { |
| local ret_status="%(?:%{$fg_bold[green]%}➜ :%{$fg_bold[red]%}➜ %s)" | |
| PROMPT='${ret_status}%{$fg_bold[green]%}%p$(rvm_gemset)%{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}' | |
| ZSH_THEME_GIT_PROMPT_PREFIX="git:(%{$fg[red]%}" | |
| ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" | |
| ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}) %{$fg[yellow]%}✗%{$reset_color%}" | |
| ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%})" | |
| # Determine if we are using a gemset. | |
| function rvm_gemset() { |
User.objects.all()User.objects.filter(age__gt=32)User.objects.profiles().filter(is_member=True)I've been programming Python for a few years. Should have known some of this stuff already, but there's always room to learn more.
raw string vs normal string. Just use the r'' to not have to escape when I don't want to escape. 😄
In [5]: r'\n'
Out[5]: '\\n'
In [6]: '\n'
Out[6]: '\n'| # ASSUMES you want Python 2.7.5 as your system default | |
| cd /usr/bin | |
| sudo ln -sf /usr/local/Cellar/python/2.7.5/bin/python python2.7 | |
| sudo ln -sf /usr/local/Cellar/python/2.7.5/bin/python-config python2.7-config | |
| sudo ln -sf /usr/local/Cellar/python/2.7.5/bin/pythonw pythonw2.7 | |
| sudo ln -sf python2.7 python | |
| sudo ln -sf pythonw2.7 pythonw | |
| sudo ln -sf python2.7-config python-config |