Related Setup: https://gist.github.com/hofmannsven/6814278
Related Pro Tips: https://ochronus.com/git-tips-from-the-trenches/
| # -*- coding: utf-8 -*- | |
| import os | |
| import StringIO | |
| import hashlib | |
| try: | |
| from boto.s3.connection import S3Connection | |
| from boto.s3.key import Key | |
| except ImportError: | |
| raise ImproperlyConfigured, "Could not load Boto's S3 bindings." |
| --- | |
| # ^^^ YAML documents must begin with the document separator "---" | |
| # | |
| #### Example docblock, I like to put a descriptive comment at the top of my | |
| #### playbooks. | |
| # | |
| # Overview: Playbook to bootstrap a new host for configuration management. | |
| # Applies to: production | |
| # Description: | |
| # Ensures that a host is configured for management with Ansible. |
| If: | |
| - you add and commit with the wrong email address in git, and | |
| - your remote has a hook set up to prevent you from pushing with the bad address | |
| Then you need to amend the author of your commit before push can succeed: | |
| 1. fix your email address in git config: | |
| $ git config user.name "Your Name" |
Related Setup: https://gist.github.com/hofmannsven/6814278
Related Pro Tips: https://ochronus.com/git-tips-from-the-trenches/
| #!/usr/bin/env python | |
| from Foundation import NSUserNotification | |
| from Foundation import NSUserNotificationCenter | |
| from Foundation import NSUserNotificationDefaultSoundName | |
| from optparse import OptionParser | |
| def main(): | |
| parser = OptionParser(usage='%prog -t TITLE -m MESSAGE') |
Go to the egghead website, i.e. Building a React.js App
run
$.each($('h4 a'), function(index, video){
console.log(video.href);
});When you modify a file in your repository, the change is initially unstaged. In order to commit it, you must stage it—that is, add it to the index—using git add. When you make a commit, the changes that are committed are those that have been added to the index.
git reset changes, at minimum, where your current branch is pointing. The difference between --mixed and --soft is whether or not your index is also modified. So, if we're on branch master with this series of commits:
- A - B - C (master)
HEADpoints to C and the index matches C.
| from fabric.api import env | |
| env.use_ssh_config = True | |
| env.forward_agent = True | |
| env.roledefs = { | |
| # key # hostname from config | |
| 'foo': ['foo.production'], | |
| } |
| # simple decorator for logging out django db queries | |
| # just put it along with other decorators before view or | |
| # db-loading stuff. than go to your console and see whats going on. | |
| # example: | |
| # | |
| # @log_db_queries | |
| # @login_required | |
| # def your_view(request, args...): | |
| # your stuff | |
| def log_db_queries(f): |