git clone git://repo.or.cz/fast-export.git
git init git_repo
cd git_repo
~/Desktop/fast-export/hg-fast-export.sh -r /path/to/old/mercurial_repo
git checkout HEAD
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
import simplejson | |
from django.http import HttpResponse | |
from django.conf import settings | |
class JSONResponse(HttpResponse): | |
def __init__(self, request, data): | |
indent = 2 if settings.DEBUG else None |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
jQuery templates use constructs like: | |
{{if condition}} print something{{/if}} | |
This, of course, completely screws up Django templates, | |
because Django thinks {{ and }} mean something. | |
Wrap {% verbatim %} and {% endverbatim %} around those | |
blocks of jQuery templates and this will try its best |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ find -name "*.html" | xargs sed -i "s/{{ STATIC_URL }}\([^\"]\+\)/{% static '\1' %}/g" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
include README.md | |
global-include *.html | |
global-include *.js | |
global-include *.css | |
global-include *.json | |
global-include *.txt | |
global-include *.sql |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.test.utils import ( | |
setup_test_template_loader, | |
restore_template_loaders, | |
) | |
class MyTest(TestCase): | |
def setUp(self): | |
setup_test_template_loader({ | |
"basic.html": "Basic", |
Install a .deb file
dpkg -i package_file.deb
Uninstall a .deb file
dpkg -r package_name
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* -- boxel --------------------------- */ | |
.boxel { | |
background-color: #eee; | |
border-radius: 4px; | |
padding: 10px 0; | |
color: #666; | |
text-align: center; | |
-webkit-transition: background-color 0.25s linear; | |
-moz-transition: background-color 0.25s linear; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.template import Template | |
from django.test import TestCase | |
from django.test.client import RequestFactory | |
from django.test.utils import ( | |
setup_test_template_loader, | |
restore_template_loaders, | |
override_settings, | |
) | |
class TemplateTest(TestCase): |