This file contains 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
diff --git a/django/contrib/sites/management.py b/django/contrib/sites/management.py | |
index 1987274..40f93ae 100644 | |
--- a/django/contrib/sites/management.py | |
+++ b/django/contrib/sites/management.py | |
@@ -8,9 +8,15 @@ from django.contrib.sites import models as site_app | |
def create_default_site(app, created_models, verbosity, db, **kwargs): | |
if Site in created_models: | |
+ domain = "example.com" | |
+ if kwargs.get('interactive', True): |
This file contains 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 scrapy.spider import BaseSpider | |
from scrapy.http import FormRequest, Request | |
from scrapy.selector import HtmlXPathSelector | |
class DjangoSpider(BaseSpider): | |
domain_name = "django.local" | |
start_urls = ["http://localhost:8000/admin/"] | |
extra_domain_names = ["localhost"] | |
def parse(self, response): |
This file contains 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
# HG changeset patch | |
# Parent b83d4a597f5fefe33a4eb0a7a4d4027402140870 | |
# User Rolando Espinoza La fuente <[email protected]> | |
diff --git a/django/test/testcases.py b/django/test/testcases.py | |
--- a/django/test/testcases.py | |
+++ b/django/test/testcases.py | |
@@ -7,7 +7,7 @@ from django.conf import settings | |
from django.core import mail | |
from django.core.management import call_command |
This file contains 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
function! EnableVirtualEnv() | |
python << EOF | |
import vim | |
import os | |
import sys | |
if 'VIRTUAL_ENV' in os.environ: | |
vim.command('let g:virtualenv_found = 1') | |
# enable virtualenv environment within vimruntime | |
activate_this = os.path.join(os.environ['VIRTUAL_ENV'], 'bin/activate_this.py') | |
if os.path.isfile(activate_this): |
This file contains 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
""" | |
Based on | |
http://www.bitbucket.org/mitsuhiko/jinja2-main/src/tip/ext/djangojinja2.py | |
""" | |
import jinja2 | |
from django.conf import settings | |
from django.core.exceptions import ImproperlyConfigured | |
from django.template import TemplateDoesNotExist | |
from django.template.loader import BaseLoader |
This file contains 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
""" | |
Restarts the application if any file changed. | |
Borrowed from Tornado and Django. | |
Usage: | |
import txautoreload | |
txautoreload.start() | |
""" | |
import types | |
import os |
This file contains 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
""" file mytest.py """ | |
# you require to return a HttpResponse instance in your view | |
from django.http import HttpResponse | |
# handler* are required for the urlresolver | |
from django.conf.urls.defaults import patterns, handler404, handler500 | |
# minimal settings | |
DEBUG = True | |
# tell django to use this file to find urlpatterns. see below | |
ROOT_URLCONF = "mytest" |
This file contains 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
/* | |
Dropbox.com hiring questions | |
http://www.dropbox.com/webengineer | |
1) | |
*/ | |
function countdown(num) { | |
for (var i=0; i <= num; i += 1) { | |
setTimeout(function() { | |
alert(num - i); | |
}, i * 1000); |
This file contains 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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# author: Rolando Espinoza La fuente | |
from scrapy.conf import settings | |
from scrapy.core import signals | |
from scrapy.core.manager import scrapymanager | |
from scrapy.item import Item, Field | |
from scrapy.selector import HtmlXPathSelector | |
from scrapy.spider import BaseSpider |
This file contains 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
"""FizzBuzz program""" | |
__author__ = "Rolando Espinoza La fuente <[email protected]>" | |
__version__ = "1.0" | |
def fizzbuzz(n): | |
""" | |
Returns whether Fizz or Buzz or Fizzbuzz or number. | |
""" | |
if n % 15 == 0: |