Bootstrap knowledge of LLMs ASAP. With a bias/focus to GPT.
Avoid being a link dump. Try to provide only valuable well tuned information.
Neural network links before starting with transformers.
import notifierQueue from "~/queues/notifier.server.ts"; | |
export const loader = async () => { | |
await notifierQueue.add("test", { emailAddress: "[email protected]" }); | |
return null; | |
}; |
This gist lists challenges you run into when building offline-first applications based on IndexedDB, including open-source libraries like Firebase, pouchdb and AWS amplify (more).
Note that some of the following issues affect only Safari. Out of the major browsers, Chrome's IndexedDB implementation is the best.
When this bug occurs, every time you use the indexeddb, the WAL file grows. Garbage collection doesn't seem to be working, so after a while, you end up with gigabytes of data.
open Js.String | |
module Ops = struct | |
type t = | |
| Delete of string * int | |
| Insert of string * string * int | |
| Replace of string * string * int | |
let run op = match op with | |
| Delete (str, i) -> |
PageModule.fetchModule("./MyComponent") | |
|> Js.Promise.then_(m => send(SetRootElement(m()))); |
This gist is a submission for a lightning talk on the ReactiveConf 2018.
type t; | |
type getStylesheetsHtmlMeth = {. "getStylesheetsHtml": [@bs.meth] (unit => unit)}; | |
[@bs.val] external styletron_client_option : array(string) => t = ""; | |
[@bs.module "styletron-client"] [@bs.new] external styletronClient : 'a => 'a = "default"; | |
[@bs.module "styletron-server"] [@bs.new] | |
external styletronServer : unit => getStylesheetsHtmlMeth = |
/** | |
* Making promises | |
*/ | |
let okPromise = Js.Promise.make((~resolve, ~reject as _) => [@bs] resolve("ok")); | |
/* Simpler promise creation for static values */ | |
Js.Promise.resolve("easy"); | |
Js.Promise.reject(Invalid_argument("too easy")); |
// getComponent is a function that returns a promise for a component | |
// It will not be called until the first mount | |
function asyncComponent(getComponent) { | |
return class AsyncComponent extends React.Component { | |
static Component = null; | |
state = { Component: AsyncComponent.Component }; | |
componentWillMount() { | |
if (!this.state.Component) { | |
getComponent().then(Component => { |
import React from 'react'; | |
import { shallow } from 'enzyme'; | |
import MyComponent from '../src/my-component'; | |
const wrapper = shallow(<MyComponent/>); | |
describe('(Component) MyComponent', () => { | |
it('renders without exploding', () => { | |
expect(wrapper).to.have.length(1); | |
}); |