Ready to commit, you fire your git status and you don’t see your files 🤔.
Use this command to ask Git what rule is causing this ignore:
$ git check-ignore -v filenameFor instance to see what rule ignores tests.pyc:
At some point you’ll find yourself in a situation where you need edit a commit message. That commit might already be pushed or not, be the most recent or burried below 10 other commits, but fear not, git has your back 🙂.
git commit --amendThis will open your $EDITOR and let you change the message. Continue with your usual git push origin master.
| try: | |
| # What you want to do, which might | |
| # very well raise an exception | |
| except IndexError as ex: | |
| # What do to when IndexError is raised | |
| except MyModule.itsException as ex: | |
| # What do to when MyModule raised an exception | |
| except Exception as ex: | |
| # What do to when any other Exception is raised | |
| else: |
| # The basics, who you commit as: | |
| [user] | |
| name = John Doe | |
| email = john@doe.org | |
| # Your Github username | |
| [github] | |
| user = githubusername | |
| # Some aliases to save 1000s keystrokes each year: | |
| [alias] | |
| log = log --color |
| import random | |
| def sort_rand(): | |
| random.seed('pouet') | |
| pool = [random.random() for i in range(1000)] | |
| sorted_pool = sorted(pool) | |
| return sorted_pool | |
| if __name__ == "__main__": | |
| sorted_nb = sort_rand() |
| # Cron only provides a limited environment. | |
| # To simulate it to test run your scripts | |
| # first add this to your cron: | |
| * * * * * env > ~/cronenv | |
| # This will export the limited cron environment to a file. | |
| # Now launch a new shell using this file to test your scripts: | |
| $ env - `cat ~/cronenv` /bin/sh | |
| # Tell it what email to send output to: | |
| # (You need to install Postfix locally before) |
| """Testing Django view decorators. | |
| This code was originally published as part of an article at | |
| http://tech.novapost.fr/django-testing-view-decorators-en.html | |
| To run this file: | |
| .. code-block:: sh | |
| virtualenv --distribute --no-site-packages testing |
| from fabric.api import * | |
| """ | |
| Base configuration | |
| """ | |
| env.project_name = '$(project)' | |
| env.database_password = '$(db_password)' | |
| env.site_media_prefix = "site_media" | |
| env.admin_media_prefix = "admin_media" | |
| env.newsapps_media_prefix = "na_media" |
| // This function gets cookie with a given name | |
| function getCookie(name) { | |
| var cookieValue = null; | |
| if (document.cookie && document.cookie != '') { | |
| var cookies = document.cookie.split(';'); | |
| for (var i = 0; i < cookies.length; i++) { | |
| var cookie = jQuery.trim(cookies[i]); | |
| // Does this cookie string begin with the name we want? | |
| if (cookie.substring(0, name.length + 1) == (name + '=')) { | |
| cookieValue = decodeURIComponent(cookie.substring(name.length + 1)); |