This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script setup> | |
import { reactive } from "vue"; | |
const updateState = reactive({ | |
formValues: {}, | |
formErrors: [], | |
fieldErrors: {}, | |
}); | |
const getFakeId = (array) => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div> | |
<editor-content :editor="editor" /> | |
</div> | |
</template> | |
<script setup> | |
import { EditorContent, useEditor } from "@tiptap/vue-3"; | |
import StarterKit from "@tiptap/starter-kit"; | |
import { toRef, unref, watch } from "vue"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import logging | |
import typing | |
from traceback import format_exception | |
from traceback import format_exception_only | |
logger = logging.getLogger(__name__) | |
class NiceConsumerMixin: | |
async def receive_json(self, content: typing.Dict, **kwargs): | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// this ia snippit from a factory that makes vuex actions with. we make a module per stream. | |
// these are vueX actions, mutations and state are implied. | |
async subscribeActivity(context) { | |
context.commit("setActivitySubscriptionCount"); | |
if (context.state.activitySubscriptions.count === 1) { | |
const listPromise = context.dispatch("list", { args: {} }); | |
const subscribePromise = dcrfClient.subscribe( | |
stream, | |
{}, | |
async (data, action) => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from channels.db import database_sync_to_async | |
from djangochannelsrestframework.decorators import action as dcrf_action | |
from djangochannelsrestframework.generics import GenericAsyncAPIConsumer | |
from djangochannelsrestframework.mixins import CreateModelMixin | |
from djangochannelsrestframework.mixins import DeleteModelMixin | |
from djangochannelsrestframework.mixins import ListModelMixin | |
from djangochannelsrestframework.mixins import PaginatedModelListMixin | |
from djangochannelsrestframework.mixins import PatchModelMixin | |
from djangochannelsrestframework.mixins import UpdateModelMixin | |
from djangochannelsrestframework.observer import ModelObserver |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# BSD 3-Clause License | |
# | |
# Copyright (c) 2017, Emergence by Design Inc. | |
# All rights reserved. | |
# | |
# Redistribution and use in source and binary forms, with or without | |
# modification, are permitted provided that the following conditions are met: | |
# | |
# * Redistributions of source code must retain the above copyright notice, this | |
# list of conditions and the following disclaimer. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from datetime import datetime | |
from operator import itemgetter | |
files = [ | |
{ | |
filename: '1.file', | |
mtime: datetime.now() | |
}, | |
{ | |
filename: '2.file', |