This guide will demonstrate how to mirror an SVN into a Git repo. You're the target audience if you're an SVN user, just getting started with Git and need to coax your project team over to Git.
The branching scenario has been simplified for clarity.
| #!/bin/bash | |
| # Runs any command (the args) in the virtualenv environment where this script resides. | |
| # You need to change the ACTIVATE_PATH variable | |
| # depending on where your virtualenv activate file is relative to this script. | |
| # The WORKING_DIR var controls the directory from which the command will be run. | |
| # I put this in a bin folder at the top level of my app. | |
| # my virtualenv structure: | |
| # /my_env | |
| # /my_env/bin ( with the venv activate script ) | |
| # /my_env/my_app |
Author: Casey Duncan @iamnotcasey
This Javascript constructor with inheritance pattern is designed as a lightweight alternative to other methods I've seen while still providing a nice abstraction as a 13 line function that can be easily inlined into your code.
| from os.path import splitext | |
| from django.core.exceptions import ValidationError | |
| from django.utils.translation import ugettext_lazy as _ | |
| from django.template.defaultfilters import filesizeformat | |
| class FileValidator(object): | |
| """ | |
| Validator for files, checking the size, extension and mimetype. |