Skip to content

Instantly share code, notes, and snippets.

Josh Mize jgmize

Block or report user

Report or block jgmize

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jgmize
jgmize / contentlengths.py
Created Feb 26, 2013
get URL content lengths using requests, a gevent process pool, and redis
View contentlengths.py
#!/usr/bin/env python
import logging
import re
from gevent import monkey, spawn
from gevent.pool import Pool
monkey.patch_all()
from redis import Redis
import requests
@jgmize
jgmize / gist:6529655
Created Sep 11, 2013
Proposal of how to deal with legacy PHP lang param usage conflict with funfactory.middleware.LocaleURLMiddleware
View gist:6529655
from funfactory.middleware import LocaleURLMiddleware
from django.conf import settings
class ExceptionalLocaleURLMiddleware(LocalURLMiddleware):
"""
Replacement for funfactory.middleware.LocaleURLMiddleware that supports excluding
specific paths from getting redirected if a lang param is present in the request.
"""
def process_request(self, request):
if 'lang' in request.GET and request.path in getattr(
@jgmize
jgmize / legacy_release_note_map.py
Created Jan 23, 2014
Extract relations of releases to notes from legacy db to new schema in RNA
View legacy_release_note_map.py
import json
from django.db.models import Q
from rna.models import Release, Note
def dump_release_notes_map(filename='release-notes-map.json'):
"used on the legacy side with the legacy models"
with open(filename, 'w') as f:
json.dump(
[(release.id, list(
View merge_conflict
{% if show_mobile %}
<small class="download-other os_android">
<a href="https://support.mozilla.org/kb/will-firefox-work-my-mobile-device">{{ _('Supported Devices') }}</a> |
<<<<<<< HEAD
<a href="{{ product_url('mobile', 'notes', build) }}">{{ _('What’s New') }}</a> |
<a href="/en-US/legal/privacy/firefox.html">{{ _('Privacy') }}</a>
=======
{% if build %}
<a href="/en-US/mobile/{{ build }}/notes">{{ _('What’s New') }}</a> |
{% else %}
View index.html
<!DOCTYPE html>
<meta charset="utf-8">
<style>
</style>
<body>
<script src="http://d3js.org/d3.v3.min.js"></script>
<svg width=960px height=500px>
<g transform='translate(166, 108)'>
<circle cx=142 cy=10 r=30 fill='#25B0B0'>
We couldn’t find that file to show.
View keybase.md

Keybase proof

I hereby claim:

  • I am jgmize on github.
  • I am jgmize (https://keybase.io/jgmize) on keybase.
  • I have a public key whose fingerprint is 879B F8F5 CE76 1CD2 BFD6 F2E9 DBB1 76AA 9894 5BFE

To claim this, I am signing this object:

View button404s.py
#!/usr/bin/env python
import mrjob.job
import mrjob.protocol
IP = 1
DOMAIN = 2
DATETIME = 4
METHOD = 5
URL = 6
@jgmize
jgmize / correlated_locale_redirects.py
Created Sep 29, 2014
correlated locale redirects
View correlated_locale_redirects.py
#!/usr/bin/env python
import re
import mrjob.job
import mrjob.protocol
IP = 1
DOMAIN = 2
DATETIME = 4
You can’t perform that action at this time.