One Paragraph of project description goes here
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
from django.contrib import admin | |
from django.contrib.flatpages.models import FlatPage | |
# Note: we are renaming the original Admin and Form as we import them! | |
from django.contrib.flatpages.admin import FlatPageAdmin as FlatPageAdminOld | |
from django.contrib.flatpages.admin import FlatpageForm as FlatpageFormOld | |
from django import forms | |
from ckeditor.widgets import CKEditorWidget |
#!/usr/bin/env bash | |
. paver_autocomplete | |
. fabric_autocomplete |
# To strip/remove HTML tags from an existing string we can use the strip_tags function. | |
# import the strip_tags | |
from django.utils.html import strip_tags | |
# simple string with html inside. | |
html = '<p>paragraph</p>' | |
print html # will produce: <p>paragraph</p> | |
stripped = strip_tags(html) |
#!/bin/bash -e | |
# | |
# Git pre-commit hook that blocks commits for files that contain swear words. | |
# | |
# Created by Dave Hall - http://davehall.com.au | |
# Distributed under the terms of the WTFPL - http://www.wtfpl.net/ | |
# | |
# Please don't use this fucking script, it is shit! | |
# |
""" | |
What if you suddenly need to have access to the context object from within | |
certain filters, and it would be costly to alter its syntax? Well, that | |
just happend to me. Here is my solution. | |
""" | |
def get_context(max_depth=4): | |
"""A simple (and perhaps dangerous) way of obtaining a context. Keep | |
in mind these shortcomings: | |
1. There is no guarantee this returns the right 'context'. |
### | |
### | |
### UPDATE: For Win 11, I recommend using this tool in place of this script: | |
### https://christitus.com/windows-tool/ | |
### https://github.com/ChrisTitusTech/winutil | |
### https://www.youtube.com/watch?v=6UQZ5oQg8XA | |
### iwr -useb https://christitus.com/win | iex | |
### | |
### |
curl -L http://bit.ly/10hA8iC | bash |
This is a guide for aligning images.
See the full Advanced Markdown doc for more tips and tricks
# One liner | |
wget --recursive --page-requisites --adjust-extension --span-hosts --convert-links --restrict-file-names=windows --domains yoursite.com --no-parent yoursite.com | |
# Explained | |
wget \ | |
--recursive \ # Download the whole site. | |
--page-requisites \ # Get all assets/elements (CSS/JS/images). | |
--adjust-extension \ # Save files with .html on the end. | |
--span-hosts \ # Include necessary assets from offsite as well. | |
--convert-links \ # Update links to still work in the static version. |