A ZSH theme optimized for people who use:
- Solarized
- Git
- Unicode-compatible fonts and terminals (I use iTerm2 + Menlo)
For Mac users, I highly recommend iTerm 2 + Solarized Dark
| # The latest version of this script is now available at | |
| # https://github.com/jasoncodes/dotfiles/blob/master/aliases/rbenv.sh | |
| VERSION=1.9.3-p286 | |
| brew update | |
| brew install rbenv ruby-build rbenv-vars readline ctags | |
| if [ -n "${ZSH_VERSION:-}" ]; then | |
| echo 'eval "$(rbenv init - --no-rehash)"' >> ~/.zshrc | |
| else | |
| echo 'eval "$(rbenv init - --no-rehash)"' >> ~/.bash_profile |
| """A very simple example to show what is required to get the excellent deform module from the Pylon's project to work with Flask. | |
| DeForm is a Pylon's module capable of automatically creating HTML forms that conform to a schema of classes defined in Python through the Colander module. The transformation between Schema<-->Form data is handled by another module called Peppercorn. More information about how these three modules work together can be found at: http://docs.pylonsproject.org/projects/deform/en/latest/?awesome | |
| Although DeForm is a Pylon's project, it can also operate as a stand-alone module. This Gist contains all the necessary changes to objects provided by Flask so that DeForm can serialize and deserialize data posted through a Flask.Request. | |
| The basic thing that this gist is trying to demonstrate is how to derive from a Flask.Request object in order to change the data type of the Flask.Request.form object that stores the data posted by the client to the server. By default, Flask uses a MultiDict i |
| *~ | |
| *.pyc | |
| .vagrant | |
| venv |
| from bs4 import BeautifulSoup as bs | |
| from pyquery import PyQuery as pq | |
| from lxml.html import fromstring | |
| import re | |
| import requests | |
| import time | |
| def Timer(): |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000| # A guide to prevent pain and suffering while upgrading to OS X Mavericks | |
| # This will vary greatly depending on system set up, so read the instructions carefully | |
| # Back up Virtulenvs | |
| #################### | |
| # Very important! | |
| # For each virtualenv you have, run "pip freeze > requirements.txt" while in the activated virtualenv | |
| # in order to prevent loss of dependencies during the upgrade. |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| #!/bin/bash | |
| MONGO_DATABASE="your_db_name" | |
| APP_NAME="your_app_name" | |
| MONGO_HOST="127.0.0.1" | |
| MONGO_PORT="27017" | |
| TIMESTAMP=`date +%F-%H%M` | |
| MONGODUMP_PATH="/usr/bin/mongodump" | |
| BACKUPS_DIR="/home/username/backups/$APP_NAME" |