Skip to content

Instantly share code, notes, and snippets.

View LondonAppDev's full-sized avatar

Mark Winterbottom LondonAppDev

View GitHub Profile
@renoirb
renoirb / etc-salt-master-d-pillars.conf
Created November 27, 2013 18:36
Separating a secret pillar repository, and spreading SSL certificates among hosts.
## in /etc/salt/master.d/pillars.conf
pillar_roots:
base:
- /srv/pillar
- /srv/private/pillar
@mariocesar
mariocesar / jenkins.sh
Last active January 5, 2016 12:11
Jenkins build script for a Django project
export PIP_DOWNLOAD_CACHE=/var/lib/jenkins/pip-cache
export AQUIPAGO_ENVIRONMENT=testing
make
env/bin/pip install -r requirements/base.txt --download-cache=/var/lib/jenkins/pip-cache --use-mirrors --timeout 1
env/bin/pip install -r requirements/project.txt --download-cache=/var/lib/jenkins/pip-cache --use-mirrors --timeout 1
env/bin/python runtests.py || :
env/bin/pylint --rcfile=.pylintrc aquipago --ignore=test > reports/pylint.txt || :
@techtonik
techtonik / caller_name.py
Created March 21, 2012 19:29
Python - inspect - Get full caller name (package.module.function)
# Public Domain, i.e. feel free to copy/paste
# Considered a hack in Python 2
import inspect
def caller_name(skip=2):
"""Get a name of a caller in the format module.class.method
`skip` specifies how many levels of stack to skip while getting caller
name. skip=1 means "who calls me", skip=2 "who calls my caller" etc.
@sloped
sloped / paging.php
Created March 19, 2012 16:21
Bootstrap Paging and Wordpress
<?php
//Use this function to create pagingation links that are styleable with Twitter Bootstrap
function paging() {
global $wp_query;
$total_pages = $wp_query->max_num_pages;
if ($total_pages > 1){
$current_page = max(1, get_query_var('paged'));