A "Best of the Best Practices" (BOBP) guide to developing in Python.
- "Build tools for others that you want to be built for you." - Kenneth Reitz
- "Simplicity is alway better than functionality." - Pieter Hintjens
| pm list packages -f |
| #!/bin/bash | |
| set -o errexit # exit on errors | |
| set -o nounset # exit on use of uninitialized variable | |
| set -o errtrace # inherits trap on ERR in function and subshell | |
| trap 'traperror $? $LINENO $BASH_LINENO "$BASH_COMMAND" $(printf "::%s" ${FUNCNAME[@]:-})' ERR | |
| trap 'trapexit $? $LINENO' EXIT | |
| function trapexit() { |
| # Something in lines of http://stackoverflow.com/questions/348630/how-can-i-download-all-emails-with-attachments-from-gmail | |
| # Make sure you have IMAP enabled in your gmail settings. | |
| # Right now it won't download same file name twice even if their contents are different. | |
| import email | |
| import getpass, imaplib | |
| import os | |
| import sys | |
| detach_dir = '.' |
| #!/usr/bin/env python | |
| """MailBox class for processing IMAP email. | |
| (To use with Gmail: enable IMAP access in your Google account settings) | |
| usage with GMail: | |
| import mailbox |
THIS GIST WAS MOVED TO TERMSTANDARD/COLORS REPOSITORY.
PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!
This configuration is no longer updated
| git branch -m old_branch new_branch # Rename branch locally | |
| git push origin :old_branch # Delete the old branch | |
| git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote |
| am broadcast "intent:#Intent;action=r1d1_to_front;end" | |
| am broadcast "intent:#Intent;action=ros_to_unity;end" | |
| am broadcast -a edu.mit.media.prg.ros_android_intents.intent_to_ros -e data bar |
| #!/usr/bin/python | |
| import chess | |
| import chess.uci | |
| import sys | |
| import time | |
| MOVETIME = 120.0 |