Skip to content

Instantly share code, notes, and snippets.

View mallison's full-sized avatar

Mark Allison mallison

  • Marvel
  • Stranraer
View GitHub Profile
@mallison
mallison / machine.js
Last active January 16, 2023 14:41
Generated by XState Viz: https://xstate.js.org/viz
const mediaPermissionsMachine = Machine(
{
id: 'mediaPermissions',
type: 'parallel',
// schema: {
// context: {} as Context,
// },
context: {
required: true,
webcam: true,
@mallison
mallison / event.json
Created May 15, 2019 13:34
Single schema 🤔
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "http://example.com/root.json",
"type": "object",
"title": "The Root Schema",
"properties": {
"trigger": {
"oneOf": [
{
"$ref": "#/definitions/tapTrigger"
@mallison
mallison / runner.py
Created May 14, 2012 09:43 — forked from carljm/runner.py
Unittest2 test discovery and real dotted-path named test selection for Django
"""
An alternative Django ``TEST_RUNNER`` which uses unittest2 test discovery from
a base path specified in settings, rather than requiring all tests to be in
``tests`` module of an app.
If you just run ``./manage.py test``, it'll discover and run all tests
underneath the ``TEST_DISCOVERY_ROOT`` setting (a path). If you run
``./manage.py test full.dotted.path.to.test_module``, it'll run the tests in
that module (you can also pass multiple modules).