The navigation sidebar on the left is shown on hover
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.core.cache import cache | |
from django.core.urlresolvers import reverse | |
from django.http import HttpRequest | |
from django.utils.cache import get_cache_key | |
def expire_page_cache(view, args=None): | |
""" | |
Removes cache created by cache_page functionality. | |
Parameters are used as they are in reverse() | |
""" |
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
set t_Co=256 | |
" Linje nummerering | |
set number | |
"Setter på automatisk innrykk og halverer innrykk lengden | |
set autoindent | |
set tabstop=4 shiftwidth=2 expandtab | |
let g:solarized_termcolors=256 |
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
# -*- coding: utf-8 -*- | |
import os | |
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "project.settings") | |
import newrelic.agent | |
newrelic.agent.initialize(os.path.join(os.path.dirname(os.path.dirname(__file__), 'newrelic.ini') | |
from django.core.wsgi import get_wsgi_application | |
application = get_wsgi_application() |
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
# -*- coding: utf-8 -*- | |
import django | |
if django.VERSION >= (1, 5): | |
from django.contrib.auth import get_user_model | |
User = get_user_model() | |
else: | |
from django.contrib.auth.models import User |
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
language: python | |
python: | |
- "2.6" | |
- "2.7" | |
env: | |
- DJANGO_VERSION=1.4 | |
- DJANGO_VERSION=1.5 |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script type="text/javascript" src="http://code.jquery.com/jquery-1.10.2.min.js"></script> | |
<script type="text/javascript"> | |
$(document).ready(function(){ | |
var id, | |
image = $("#image"), | |
current = 0, | |
urls = [ |
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
file{ [ '/backups', '/backups/redis' ]: | |
ensure => 'directory', | |
owner => 'root' | |
} | |
cron{ 'redis-bgsave': | |
command => 'redis-cli bgsave', | |
user => 'root', | |
hour => '0-23/2', | |
minute => 3, | |
} |
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
# Define: postgresql::backup | |
# | |
# Backup of a postgresql database using pgdump. | |
# Usage: postgresql::backup { [ 'db1', 'db2' ]: } | |
define postgresql::backup { | |
file{ [ '/backups', '/backups/postgres', "/backups/postgres/${title}" ]: | |
ensure => 'directory', | |
owner => 'postgres' | |
} |
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 sys | |
import csv | |
import argparse | |
def find_first_common_column(list_1, list_2): | |
column = list(set(list_1) & set(list_2))[0] | |
for i, col in enumerate(list_1): | |
if col == column: | |
place_1 = i |
OlderNewer