This file contains hidden or 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
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
This file contains hidden or 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 is a small library I wrote when I was doing R&D work and needed a way to communicate | |
* between an iFrame on the same domain and its parent tab. The existing browser API kinda sucked | |
* and had a lot of issues, and it wasn't particularly enjoyable to use. So I made this small library to solve that. | |
* | |
* The library allows you to communicate using *channels*, which are just streams of events with a given name. | |
* You can subscribe to events of a particular type. Each event type has its own event queue, and each subscriber | |
* must subscribe to a particular event type. This keeps things simple and fast. | |
* | |
* Events are buffered and sent asychronously. There are two ways to send events: firing and blocking. |
This file contains hidden or 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 currentUser from "app/auth/queries/currentUser" | |
// You'd need some sort of transform to evaluate this function and turn it into an object | |
// that could be passed to the server. You could just replace the definition of the `currentUser` | |
// function with: | |
// const currentUser = (args) => args | |
// and then just send the returned params to the server. | |
export const query = currentUser(); | |
// This displays when the query is loading. |
This file contains hidden or 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
////////////////////////////////////////////////////////////////////////////// | |
// | |
// Angel.js | |
// | |
////////////////////////////////////////////////////////////////////////////// | |
//---------------------------------------------------------------------------- | |
// | |
// Helper functions | |
// |
This file contains hidden or 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
export function bootstrap() { | |
// All of your code for setting stuff up should go in here. | |
// This will be run once when our module loads, and then again on every reload. | |
} | |
export function teardown() { | |
// This is where you delete anything you created. For instance, if you add a canvas element | |
// using JS, you should remove that here. Any listeners should be removed as well. | |
} |
This file contains hidden or 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
module samw.dev/ebiten | |
go 1.15 | |
require ( | |
github.com/aquilax/go-perlin v1.1.0 | |
github.com/hajimehoshi/ebiten/v2 v2.2.4 | |
) |
This file contains hidden or 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
// I asked Claude to write Hello World. Then I continually asked it to extract new classes until we got the below. | |
// Introducing the world's most complicated Hello World program. | |
class Printable { | |
toString() { | |
throw new Error('toString() method must be implemented'); | |
} | |
} | |
class MessageCreator { |
This file contains hidden or 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 { | |
Owner, | |
type Evolu, | |
type EvoluSchema, | |
type QueryResult, | |
type SyncState, | |
} from "@evolu/common"; | |
export * from "@evolu/common"; | |
export * from "@evolu/common-web"; |
OlderNewer