Mix.install([
{:torchx, "~> 0.1.0-dev", github: "elixir-nx/nx", sparse: "torchx"},
{:nx, "~> 0.1.0-dev", github: "elixir-nx/nx", sparse: "nx", override: true}
])
"""This is an example of how to use async langchain with fastapi and return a streaming response. | |
The latest version of Langchain has improved its compatibility with asynchronous FastAPI, | |
making it easier to implement streaming functionality in your applications. | |
""" | |
import asyncio | |
import os | |
from typing import AsyncIterable, Awaitable | |
import uvicorn | |
from dotenv import load_dotenv |
defmodule NestedWeb.FormLive do | |
use NestedWeb, :live_view | |
require Logger | |
defmodule Form do | |
use Ecto.Schema | |
import Ecto.Changeset | |
embedded_schema do | |
field :name, :string |
This an ordered version of the original gist located at https://gist.github.com/marcanuy/06cb00bc36033cd12875
- -aa
- aa-
- -ab
Moved to Shopify/graphql-design-tutorial
I screwed up using git ("git checkout --" on the wrong file) and managed to delete the code I had just written... but it was still running in a process in a docker container. Here's how I got it back, using https://pypi.python.org/pypi/pyrasite/ and https://pypi.python.org/pypi/uncompyle6
apt-get update && apt-get install gdb
Disclaimer: This piece is written anonymously. The names of a few particular companies are mentioned, but as common examples only.
This is a short write-up on things that I wish I'd known and considered before joining a private company (aka startup, aka unicorn in some cases). I'm not trying to make the case that you should never join a private company, but the power imbalance between founder and employee is extreme, and that potential candidates would
defmodule AppName.IpnController do | |
@moduledoc """ | |
IPN Controller. | |
""" | |
use AppName.Web, :controller | |
def create(conn, params) do | |
# PayPal requires the params returned in the exact order given. | |
# The map needs to be a list. encode/1 keep the order of a list, |
(function() { | |
'use strict'; | |
/** | |
* Core method, similar to jQuery (only simpler) | |
* | |
* @param {String|HTMLElement} s The CSS selector to search for or HTML element to wrap with functionality | |
* @param {HTMLElement} root OPTIONAL An HTML element to start the element query from | |
* @return {Array} The collection of elements, wrapped with functionality (see API methods) | |
*/ |
#TinyMCE style toggle button
First of all, you need to define a custom format:
formats: {
custom_format: {inline: 'span', attributes: {class: 'some_css_class'}}
}
Then you'll have to add a button to your toolbar: