For educational reasons I've decided to create my own CA. Here is what I learned.
Lets get some context first.
define([ | |
'jquery', | |
'jqueryui', | |
'jquery_cookie', | |
'underscore', | |
'backbone', | |
'app/views/tapEngage.view', | |
// Using the Require.js text! plugin, we are loaded raw text | |
// which will be used as our views primary template |
import nose | |
import functools | |
_either_or_map = dict() | |
def either_or(key='default', expected_failures=1): | |
def either_or_decorator(test): | |
global _either_or_map |
def get(self, request): | |
return { | |
"rooms": [ | |
{attrName: attrVal for attrName, attrVal in model_to_dict(x).items() | |
if attrName in RoomView.ROOM_PUBLIC_FIELDS} | |
for x in Room.objects.all() | |
] | |
} |
from django.views.generic import View | |
from django.shortcuts import get_object_or_404 | |
from .decorators import json | |
from .models import RoomModel | |
from django.http import HttpResponse | |
class RoomView(View): | |
"""Room view class that implements the primary HTTP verbs (POST, GET, PUT, DELETE). |
from setuptools import setup | |
from distutils.core import Extension | |
from distutils.command.build import build | |
import os | |
from subprocess import call | |
import multiprocessing | |
from glob import glob | |
import random | |
import string | |
import re | |
allowable = re.sub(r'[IO10]', '', (string.ascii_uppercase + string.digits)) | |
def combos(place): | |
for char in allowable: |
def fib_iterative(n): | |
sequence = (0, 1) | |
if n < 2: | |
return sequence[n] | |
for _ in range(n - 2): | |
sequence = (sequence[1], sequence[0] + sequence[1]) | |
return sequence[0] + sequence[1] |
import requests | |
class MyApiClient(requests.Session): | |
def do_something(self): | |
response = self.post('/some/url', json={ | |
'param1': 'a', | |
'param2': 'b' | |
}) | |
if response.status_code == requests.codes.ok: |
# -*- coding: utf-8 -*- | |
from __future__ import unicode_literals | |
from django.db import models, migrations | |
class Migration(migrations.Migration): | |
dependencies = [ | |
('spigot', '0034_hydrated_connection_view_v2'), |