"hstore type not found in the database. "
django.db.utils.ProgrammingError: hstore type not found in the database.
please install it from your 'contrib/hstore.sql' file
Fatal error: local() encountered an error (return code 1) while
executing 'python manage.py syncdb --noinput'
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
import itertools | |
def neighbors(point): | |
x, y = point | |
yield x + 1, y | |
yield x - 1, y | |
yield x, y + 1 | |
yield x, y - 1 | |
yield x + 1, y + 1 | |
yield x + 1, y - 1 |
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
""" | |
Source: http://www.djangosnippets.org/snippets/1550/ | |
Notes | |
===== | |
This allows you to set up a breakpoint anywhere in your template code, | |
by simply writing {% pdb_debug %}. | |
You can then access your context variables using context.get(..) at the pdb | |
prompt. Optionally, install the ipdb package for colors, completion, and more (easy_install ipdb). |
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 django.generic import ListView | |
def object_list(request, queryset, extra_context=None, template_name='', paginate_by=None): | |
"""list_detail.object_list replacement. | |
This allows you to avoid having to refactor any of your function-based | |
views that used object_list into class-based views because of the | |
deprecation of object_list in >= django 1.5. If you must. |
This is not intended to be comprehensive or authoritative, just free online resources I've found valuable while learning more about Erlang.
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
# captures a complete list of the commands run by a makefile | |
make clean && make -j1 > log.txt |
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 bash | |
# Bash completion support for ssh | |
# Source: https://github.com/revans/bash-it | |
export COMP_WORDBREAKS=${COMP_WORDBREAKS/\:/} | |
_sshcomplete() { | |
local CURRENT_PROMPT="${COMP_WORDS[COMP_CWORD]}" | |
if [[ ${CURRENT_PROMPT} == *@* ]] ; then | |
local OPTIONS="-P ${CURRENT_PROMPT/@*/}@ -- ${CURRENT_PROMPT/*@/}" |
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 bash | |
# | |
# Bash completion support for Fabric (http://fabfile.org/) | |
# | |
# | |
# Copyright (C) 2011 by Konstantin Bakulin | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights |
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
/IGNORE * JOINS PARTS NICKS QUITS |