Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View Nagyman's full-sized avatar

Craig Nagy Nagyman

View GitHub Profile
@Nagyman
Nagyman / strict_roles.py
Created June 22, 2012 18:08
Decorator to strictly enforce the roles defined for a fabric task
from fabric.api import env
from fabric import tasks
from functools import wraps
def _wrap_as_new(original, new):
if isinstance(original, tasks.Task):
return tasks.WrappedCallableTask(new)
return new
def strict_roles(*role_list):
@Nagyman
Nagyman / git-big.py
Created April 23, 2012 17:50
Python Script to Identify Git Commits with Files Over a Specific Size
#!/usr/bin/env python
'''
Modified version from:
http://stackoverflow.com/questions/298314/find-files-in-git-repo-over-x-megabytes-that-dont-exist-in-head
Examples:
# Commits bigger than 1MB
python git-big.py 1048576
@Nagyman
Nagyman / fabfile.py
Created February 15, 2012 19:55
Skeleton for point-release from git
def deploy():
env.release = time.strftime('%Y%m%d%H%M%S')
upload_tar_from_git()
symlink_current_release()
restart_webserver()
def deploy_version(version):
"Specify a specific version to be made live"
require('hosts', provided_by=[localhost,webserver])
require('releases')
jQuery.facebox([
"<h1>Waitlist Availability Only</h1>",
"<p>If you continue this booking, the booking will be placed on a waitlist until",
" there is room for all passengers.",
"</p>"
].join(''));