Skip to content

Instantly share code, notes, and snippets.

from django.http import JsonResponse, StreamingHttpResponse
from django.views.decorators.csrf import csrf_exempt
import json
def streaming_view(view_func):
"""
Decorator that converts a Django view function into a streaming response view.
The view function needs to accept a 'prompt' and return a generator yielding data chunks.
"""
@n4cr
n4cr / GIF-Screencast-OSX.md
Created January 14, 2021 14:14 — forked from dergachev/GIF-Screencast-OSX.md
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

Verifying my Blockstack ID is secured with the address 1Q5N2nVUJSCMrhVHYrv4NCMc7GXRyhnr31 https://explorer.blockstack.org/address/1Q5N2nVUJSCMrhVHYrv4NCMc7GXRyhnr31
0x1E78e4b0d4965df72E76522Ec0e379fcF4C83Fa7
0x7f7adE8944250C3c99f275A01f93F6664f7A1C8E
/*
* Copyright 2012-2014 the original author or authors.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
/*
* Copyright (C) 2014 Chris Banes
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software