Skip to content

Instantly share code, notes, and snippets.

View capncodewash's full-sized avatar

Graeme West capncodewash

  • Glasgow
View GitHub Profile
RewriteEngine On
RewriteMap fedora-map prg:/wgbh/http/openvault/map.fedora.py
RewriteCond %{REQUEST_URI} Proxy #map just URIs with Proxy in them..
RewriteRule ^/fedora/get/([a-zA-Z0-9/:\-\.]+)$ ${fedora-map:$1} [QSA] # send along the query string.. hopefully the regex is about right.. ought to check it someday.
@SEJeff
SEJeff / settings_logging.py
Created July 8, 2011 22:19
How to enable debug logging for django_auth_ldap
############################## django-auth-ldap ##############################
if DEBUG:
import logging, logging.handlers
logfile = "/tmp/django-ldap-debug.log"
my_logger = logging.getLogger('django_auth_ldap')
my_logger.setLevel(logging.DEBUG)
handler = logging.handlers.RotatingFileHandler(
logfile, maxBytes=1024 * 500, backupCount=5)
@smgoller
smgoller / gist:1171102
Created August 25, 2011 16:36 — forked from mhinze/gist:123732
git svn workflow
# adapted from http://notes.jimlindley.com/2008/3/25/git-svn-that-works-for-me
# initial setup
git svn clone <svn_repo>
# begin the workflow
git svn fetch -r HEAD --ignore-paths="Package.zip" # aliased to 'git up', my Package.zip is very large.
git svn rebase -l # we just updated, no need to go back to the svn repo
# 99% of daily workflow
@dex4er
dex4er / xsd-merge.xslt
Created November 21, 2011 23:04
XSLT tools for XSD and WSDL schemas
<?xml version="1.0"?>
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsl:output version="1.0" encoding="utf-8" indent="yes" name="xml" />
<xsl:template match="/">
<xsl:apply-templates />
@myobie
myobie / mountain-lion-brew-setup.markdown
Created February 18, 2012 20:14
Get Mountain Lion and Homebrew to Be Happy

Get Mountain Lion and Homebrew to Be Happy

1) Install XCode 4.4 into /Applications

Get it from the App Store.

2) Install Command Line Tools

In XCode's Preferences > Downloads you can install command line tools.

@juanje
juanje / gist:2558286
Created April 30, 2012 13:17
Simple Vagrantfile for testign Django with Chef-solo
Vagrant::Config.run do |config|
# Every Vagrant virtual environment requires a box to build off of.
config.vm.box = "base"
# Assing IP to the VM
config.vm.network :hostonly, "10.0.33.10"
# Share directory between the host and the VM
config.vm.share_folder "git","/opt/git","/home/anarey/git/djandoapps"
@coderoshi
coderoshi / gist:3729593
Last active March 31, 2022 15:43
A Very Short Guide to Writing Guides

A Very Short Guide to Writing Guides

This is just a few thoughts on the topic of writing technical guides. This was intended for Basho's engineering team, but this may apply to open source projects in general.

Audience

It's commonly preached that the first step in writing is to identify your audience; to whom are you writing? This is the most well known, most repeated, and most overlooked step of writing in general and technical writing in particular. Take this document, for example. My audience is technical people who need to communicate technical information, and not teenagers, so I shy away from images of pop icons and memes. I use jargon and words like "identify" rather than "peep this".

Pronouns

@gregology
gregology / dashboard
Last active December 8, 2020 14:19
Service script for dashing. Update DASHING_DIR variable, add this file to /etc/init.d/ , chmod to 755, and let update rc.d with $ sudo update-rc.d dashboard defaults This scripts stops the dashing service with "killall thin" which will kill all thin services running on your server.
#!/bin/bash
# Dashing service
# Add this file to /etc/init.d/
# $ sudo cp dashboard /etc/init.d/
# Update variables DASHING_DIR, GEM_HOME, & PATH to suit your installation
# $ sudo nano /etc/init.d/dashboard
# Make executable
# $ sudo chmod 755 /etc/init.d/dashboard
# Update rc.d
# $ sudo update-rc.d dashboard defaults
@mtowers
mtowers / README.md
Last active February 24, 2022 17:19
Google Analytics Website Visitor Count Widget for Dashing with OAuth2 Authentication
@danielrbradley
danielrbradley / uk-number-plate-validation.md
Last active April 27, 2024 14:04
Regular Expression to Validate UK Number Plates

Regular Expression to Validate UK Number Plates

Regular Expression

(?<Current>^[A-Z]{2}[0-9]{2}[A-Z]{3}$)|(?<Prefix>^[A-Z][0-9]{1,3}[A-Z]{3}$)|(?<Suffix>^[A-Z]{3}[0-9]{1,3}[A-Z]$)|(?<DatelessLongNumberPrefix>^[0-9]{1,4}[A-Z]{1,2}$)|(?<DatelessShortNumberPrefix>^[0-9]{1,3}[A-Z]{1,3}$)|(?<DatelessLongNumberSuffix>^[A-Z]{1,2}[0-9]{1,4}$)|(?<DatelessShortNumberSufix>^[A-Z]{1,3}[0-9]{1,3}$)|(?<DatelessNorthernIreland>^[A-Z]{1,3}[0-9]{1,4}$)|(?<DiplomaticPlate>^[0-9]{3}[DX]{1}[0-9]{3}$)

For use in JavaScript (with named groups removed):

(^[A-Z]{2}[0-9]{2}\s?[A-Z]{3}$)|(^[A-Z][0-9]{1,3}[A-Z]{3}$)|(^[A-Z]{3}[0-9]{1,3}[A-Z]$)|(^[0-9]{1,4}[A-Z]{1,2}$)|(^[0-9]{1,3}[A-Z]{1,3}$)|(^[A-Z]{1,2}[0-9]{1,4}$)|(^[A-Z]{1,3}[0-9]{1,3}$)|(^[A-Z]{1,3}[0-9]{1,4}$)|(^[0-9]{3}[DX]{1}[0-9]{3}$)