Skip to content

Instantly share code, notes, and snippets.

View RichardBronosky's full-sized avatar

Bruno Bronosky RichardBronosky

View GitHub Profile
cat << USAGE > /dev/null
To run this script directly from github simply paste the following line into your shell:
curl -sLO http://j.mp/iFANJ6 && source iFANJ6
USAGE
# We're going to build out a new overrides dir so we don't effect the other VMs while we test
mkdir -p /tmp/django/config_overrides
# ...and use it
@RichardBronosky
RichardBronosky / django-bootstrap
Created June 4, 2011 04:27
This is my response to a thread on django-developers regarding default project layout http://groups.google.com/group/django-developers/browse_thread/thread/2b88ddc6dd68ed6
#!/usr/bin/env bash
# This script was made by a master bash hacker, hence to following 2 settings
set -o errexit
set -o nounset
cat << EOF
django-bootstrap -- generates a complete django project
usage: django-bootstrap [app_name] [project_name] [virtualenv_path/name] [admin_name (default=admin)] [admin_password (default=admin)]
@RichardBronosky
RichardBronosky / vim.rb
Created June 22, 2011 15:56
VIM --enable-python homebrew formula
# This gives a Mac user the "latest version" of vim (if this is kept up to date) with python support compiled in.
# To install it, just do: brew install https://raw.github.com/gist/1040416/vim.rb
# To find the latest release, look for "updated for version [0-9.]+" on http://code.google.com/p/vim/source/list and update lines 9 & 10 below.
require 'formula'
class Vim < Formula
# Get stable versions from hg repo instead of downloading an increasing
# number of separate patches.
url 'https://vim.googlecode.com/hg/', :revision => '70c8f54e7efb'
version '7.3.230'
@RichardBronosky
RichardBronosky / vpnbust
Created June 29, 2011 13:25
A tool for modifying the routing table for users of the Cox VPN.
#!/usr/bin/env sh
# usage: vpnbust [-u] hostname_or_ip [hostname_or_ip ...]
# -u flag to indicate that routes should unbust or use the VPN.
# This asumes that your route to google.com is good.
interface=$(route get google.com|awk '/interface/{print $2}')
# If that doesn't work, you will have to choose en0 or en1 manually based on whatever ifconfig tells you.
tunnel=$(route get vcs.ddtc.cmgdigital.com|awk '/interface/{print $2}')
@RichardBronosky
RichardBronosky / sections.txt
Created August 7, 2011 03:33
Section headers for inspiration in writing a scientific paper or bug report.
Title
Authors and Affiliation
Abstract
Introduction
Methods
Materials and Methods
@RichardBronosky
RichardBronosky / tmuxsync
Created August 8, 2011 06:12
Tmux session syncronizer
#!/usr/bin/env bash
## NOTE: currently this script doesn't have any syncing logic.
## It simply links to this session, all of the windows in the session passed as argument1.
## In the future I hope to make it idempotent.
## I could not find a quick way to get the tty or the pid of the windows.
## But, the good news is that renaming a window in one session changes it in all sessions.
## Therefore, I can save the name in a var, rename, look for it in the other session, change the name back.
## That will be the next advance.
• medley.mobile.helpers.redirect_if_needed alters settings.TEMPLATE_DIRS if is_clarkhoward(existing_host)
• storyville.conf.sites.__init__ has PER_REQUEST_SETTINGS_POST_HOOK switching on: request.site_is_www or request.site_is_root
• what to do with constants.MOBILE_SITE/constants.FULL_SITE?
• medley.mobile.views useful at all?
• medley.mobile.tests useful at all?
• medley.mobile.middleware usefull at all?
• medley.mobile.helpers.is_mobile_enabled is probably useful, is it used everywhere?
• soloist.clarkhoward.views.archive_url useful?
<html>
<!--
Author: Richard Bronosky
Generated online via: http://j.mp/pyQfTl
Available on github: https://gist.github.com/gists/1141590
Idea: http://www.instructables.com/id/QR-Code-Bad-Jokes/
-->
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script src="https://raw.github.com/eklitzke/autoresize.jquery.js/master/autoresize.jquery.js"></script>
@RichardBronosky
RichardBronosky / README.txt
Created August 20, 2011 06:00
Apache mod_rewrite unit tests
ReUnit - Unit tests for HTTP Redirects.
# ATTENTION: Please do not think badly of me for this code!
# I REALLY WANT TO REDO THIS IN PYTHON AND USE YAML!!!
# It started out as a oneliner! https://gist.github.com/1158733/2f9aa7e2db9ccfbda4669c2102daebacf8a04284#L6
Contents:
reunit.sh - This is the main script and the purpose of this repo. It reads a text file full of tests.
tests.txt - This holds the tests that will be run. It's format is Identical to the output of reunit.sh an urltest
urltest - This is the test utility used by reunit.sh. It was extracted into an executable so that it could be used for single tests or creating entries for tests.txt
@RichardBronosky
RichardBronosky / medley.global.conf
Created August 24, 2011 21:37
[CMSMI-190] Redirect non-mobile-ready content types to www.
<Directory /services/django>
Options FollowSymLinks
</Directory>
Alias /media "/services/django/vm/storyville/vm/media/"
<Location "/media">
SetHandler None
Order allow,deny
allow from all
</Location>