Skip to content

Instantly share code, notes, and snippets.

View ashchristopher's full-sized avatar

Ash Christopher ashchristopher

  • Shopify
  • Toronto, Ontario
View GitHub Profile
# Hey coops..
#
# Imagine yourself on the other side of the table: two job openings, hundreds of resumes,
# _all of which_ look friggin' identical. Yeah, the HR departments at your MegaCorp XYZ are using
# automated tools to scan for keywords, and the coop department at your school is trying to beat
# you into submission to follow some "predefined template".. But, unless what you're aspiring to
# is to be an automaton at MegaCorp XYZ, relegated to writing test harnesses for code that will
# never see the light of day.. please do yourself a favor, and _be different_! Be bold, dammit.
#
# (Frankly, I'm falling asleep while reading your resumes.. Wake me up! Srsly.)
/*
* A simple Google maps Javascript widget which will display a map and
* a marker with the ability to move the marker, then setting the
* lat/lng of the marker into the specified (or default) fields.
*/
var google_map_location = new function() {
var jQuery;
var init_options;
var geocoder;

Step 1

Get a VPS that offers 2 or more IP addresses.

Step 2

From the WHM cPanel, find the menu item Service Configuration, select Apache Configuration and then click on Reserved IPs Editor.

Step 3

@ashchristopher
ashchristopher / background.sh
Created January 17, 2011 01:05 — forked from zaius/background.sh
How to redirect a running process output to a file and log out
ctrl-z
bg
touch /tmp/stdout
touch /tmp/stderr
gdb -p $!
# In GDB
p dup2(open("/tmp/stdout", 1), 1)
p dup2(open("/tmp/stderr", 1), 2)
#!/usr/bin/env python
"""
Use pip to get a list of local packages to check against one or more package
indexes for updated versions.
"""
import pip
import sys, xmlrpclib
from cStringIO import StringIO
from distutils.version import StrictVersion, LooseVersion
@ashchristopher
ashchristopher / test.py
Created May 26, 2011 03:18 — forked from joestump/test.py
A drop-in replacement for Django's test mange.py command that uses coverage.
from django.conf import settings
from django.core.management.base import CommandError
from optparse import make_option
import re
import sys
try:
from south.management.commands.test import Command as BaseCommand
except ImportError:
@ashchristopher
ashchristopher / jquery.500frame.js
Created August 12, 2011 19:35 — forked from defrex/jquery.500frame.js
pop-up any 500s in an iframe using jQuery. Especially useful for Django errors.
$(document).bind('ajaxError', function(e, jqXHR){
if (jqXHR.status == 500){
var erframe = document.createElement('iframe');
$('body').append(erframe);
$(erframe).css({
'position': 'absolute',
'top': '5%', 'left': '50%',
'width': '90%', 'height': '90%',
'marginLeft': '-45%',
'z-index' : '9999999'
@ashchristopher
ashchristopher / README.rst
Created December 15, 2011 19:22 — forked from wolever/README.md
EMPMYMIP: Easily Maintain a PyPI Mirror of Your Important Packages!

EMPMYMIP: Easily Maintain a PyPI Mirror of Your Important Packages!

Status

EMPMYMIP seems to mostly kind of work for me. It might even do the same for you!

The implementation is kind of a huge hack, though, and it might very well

@ashchristopher
ashchristopher / test-coverage.py
Created January 22, 2012 02:40 — forked from acdha/test-coverage.py
A custom Django test runner with support for coverage.py and graceful handling for app selection and various testing gotchas
#!/usr/bin/env python
"""
Run Django Tests with full test coverage
This starts coverage early enough to get all of the model loading &
other startup code. It also allows you to change the output location
from $PROJECT_ROOT/coverage by setting the $TEST_COVERAGE_OUTPUT_DIR
environmental variable.
"""
@ashchristopher
ashchristopher / test.py
Created April 6, 2012 20:52 — forked from joestump/test.py
A drop-in replacement for Django's test mange.py command that uses coverage.
from django.conf import settings
from django.core.management.base import CommandError
from optparse import make_option
import re
import sys
try:
from south.management.commands.test import Command as BaseCommand
except ImportError: