Skip to content

Instantly share code, notes, and snippets.

View bmcharek's full-sized avatar

Besma bmcharek

  • Amsterdam, The Netherlands
View GitHub Profile
@JamesMGreene
JamesMGreene / gitflow-breakdown.md
Last active April 30, 2024 14:11
`git flow` vs. `git`: A comparison of using `git flow` commands versus raw `git` commands.

Initialize

gitflow git
git flow init git init
  git commit --allow-empty -m "Initial commit"
  git checkout -b develop master

Connect to the remote repository

@eezis
eezis / redirectmiddleware.py
Created December 7, 2013 17:48
A Django Middleware Redirection class that provides a "last chance" to grab a developing 404 response and redirect it to a new URL.
"""
This piece of middleware grabs onto the tail end of process_response hook
and allows for redirects to be applied using regex matches.
Use Case: A legacy website with many old urls will have accumulated SEO mojo based
on external links. When the site is converted to a new fromat (say, drops the cruft like '.html')
or goes from abbreviated forms /art/id/t/234234 to /article/2014/january/technology/get-a-better-job
the old urls are at risk of breakage and could lose SEO mojo unless preserved
Best preservation comes from redirecting old content to new, which is easily accomplished