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
set encoding=utf8 | |
set nopaste | |
set expandtab | |
set textwidth=0 | |
set tabstop=4 | |
set softtabstop=4 | |
set shiftwidth=4 | |
set autoindent | |
set backspace=indent,eol,start | |
set incsearch |
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 http://docs.webfaction.com/software/django/troubleshooting.htmlhighlight=django%20remote%20addres#accessing-remote-addr | |
class WebFactionFixes(object): | |
"""Sets 'REMOTE_ADDR' based on 'HTTP_X_FORWARDED_FOR', if the latter is | |
set. | |
Based on http://djangosnippets.org/snippets/1706/ | |
""" | |
def process_request(self, request): | |
if 'HTTP_X_FORWARDED_FOR' in request.META: |
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
export WORKON_HOME=$HOME/.virtualenvs | |
export PROJECT_HOME=$HOME/Projects | |
source /usr/local/bin/virtualenvwrapper.sh |
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
$ mkproject tusul4 | |
New python executable in tusul4/bin/python | |
Installing setuptools............done. | |
Installing pip...............done. | |
virtualenvwrapper.user_scripts creating /home/blackrock/.virtualenvs/tusul4/bin/predeactivate | |
virtualenvwrapper.user_scripts creating /home/blackrock/.virtualenvs/tusul4/bin/postdeactivate | |
virtualenvwrapper.user_scripts creating /home/blackrock/.virtualenvs/tusul4/bin/preactivate | |
virtualenvwrapper.user_scripts creating /home/blackrock/.virtualenvs/tusul4/bin/postactivate | |
virtualenvwrapper.user_scripts creating /home/blackrock/.virtualenvs/tusul4/bin/get_env_details | |
Creating /home/blackrock/Projects/tusul4 |
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
<!-- this usually goes in <project-root>/templates/uni_form/field.html --> | |
{% if field.is_hidden %} | |
{{ field }} | |
{% else %} | |
<div class="clearfix {% if field.errors %}error{% endif %}"> | |
<label for="{{ field.auto_id }}" {% if field.field.required %}class="requiredField"{% endif %}> | |
{{ field.label|safe }}{% if field.field.required %}<span class="asteriskField">*</span>{% endif %} | |
</label> | |
<div class="input"> |
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 os | |
import sys⋅ | |
import site | |
site.addsitedir('/home/user/.virtualenvs/venv/lib/python2.7/site-packages/') | |
activate_this = os.path.expanduser("~/.virtualenvs/venv/bin/activate_this.py") | |
execfile(activate_this, dict(__file__=activate_this)) | |
from django.core.handlers.wsgi import WSGIHandler |
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
# OSQA default About page text | |
Please customize this text in the administration area | |
Here you can ask and answer questions, comment and vote for the questions of others and their answers. Both questions and answers can be revised and improved. Questions can be tagged with the relevant keywords to simplify future access and organize the accumulated material. | |
This Q&A site is moderated by its members, hopefully - including yourself! Moderation rights are gradually assigned to the site users based on the accumulated "karma" points. These points are added to the users account when others vote for his/her questions or answers. These points (very) roughly reflect the level of trust of the community. | |
No points are necessary to ask or answer the questions - so please - join us! |
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
Control the complexity. | |
Don't be ugly. | |
Beautiful is the only answer. | |
Only one option is strict. # not clear? | |
Two can still be simple. | |
Three is funny, and more is complex. |
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
#!/bin/bash | |
# A shell script to delete / drop all tables from MySQL database. | |
# Usage: ./script user password dbnane | |
# Usage: ./script user password dbnane server-ip | |
# Usage: ./script user password dbnane mysql.nixcraft.in | |
# ------------------------------------------------------------------------- | |
# Copyright (c) 2008 nixCraft project | |
# This script is licensed under GNU GPL version 2.0 or above | |
# ------------------------------------------------------------------------- | |
# This script is part of nixCraft shell script collection (NSSC) |
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
#!/bin/bash | |
# Save CSV for MN-UB, PM10 | |
let page_size=65536 | |
#parameter="pm25" | |
if [ $# -eq 0 ] | |
then | |
echo 'Parameter required. One of: pm10, pm25' |
OlderNewer