Skip to content

Instantly share code, notes, and snippets.

View brechin's full-sized avatar

Jason Brechin brechin

View GitHub Profile
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import random
from django.test import TestCase, Client
from filtertest.models import MyModel, AnotherModel
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models
from django.db import models
import computed_property
class MyModel(models.Model):
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.http import JsonResponse
from .filters import MyFilter
def model_list(request):
filter = MyFilter(request.GET)
@brechin
brechin / index.html
Last active February 19, 2018 17:23
// source https://jsbin.com
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Git Graph</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/gitgraph.js/1.11.4/gitgraph.min.js"></script>
<link rel="stylesheet" type="text/css"
href="https://cdnjs.cloudflare.com/ajax/libs/gitgraph.js/1.11.4/gitgraph.min.css"/>
</head>
<body>

How to set up stress-free SSL on an OS X development machine

One of the best ways to reduce complexity (read: stress) in web development is to minimize the differences between your development and production environments. After being frustrated by attempts to unify the approach to SSL on my local machine and in production, I searched for a workflow that would make the protocol invisible to me between all environments.

Most workflows make the following compromises:

  • Use HTTPS in production but HTTP locally. This is annoying because it makes the environments inconsistent, and the protocol choices leak up into the stack. For example, your web application needs to understand the underlying protocol when using the secure flag for cookies. If you don't get this right, your HTTP development server won't be able to read the cookies it writes, or worse, your HTTPS production server could pass sensitive cookies over an insecure connection.

  • Use production SSL certificates locally. This is annoying

Keybase proof

I hereby claim:

  • I am brechin on github.
  • I am brechin (https://keybase.io/brechin) on keybase.
  • I have a public key whose fingerprint is 467A CFC4 6C39 E0A5 2F1E 01B0 E38C DF62 5832 2EAD

To claim this, I am signing this object: