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
// Represents a date on the MLC calendar in format x.x.x.x.x | |
class MayaLongDate { | |
// Number of days in each position | |
static const List<int> moduli = [ 144000, 7200, 360, 20, 1 ]; | |
// Nunber of ms since 12/21/2012 | |
static DateTime MLC_EPOCH_13_START = DateTime.parse('2012-12-21T00:00:00+00:00'); | |
// Current date in MLC format - initialized to Baktun 13 |
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 'dart:mirrors'; | |
import 'package:core/types/serializable.dart'; | |
abstract class Reflector { | |
static MapEntry<Symbol, dynamic> _parse(VariableMirror d, Map<dynamic, dynamic> map) => | |
MapEntry(d.simpleName, map[MirrorSystem.getName(d.simpleName)]); | |
static bool isSerializable(ClassMirror d) => | |
(d.superclass != null && d.superclass.reflectedType != Object) |
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 'dart:io'; | |
import 'dart:convert'; | |
import 'dart:mirrors'; | |
import 'package:api_sdk/framework/api-method.dart'; | |
import 'package:api_sdk/framework/api-route.dart'; | |
import 'package:http_server/http_server.dart'; | |
abstract class ServiceBase { | |
InstanceMirror _self; |
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 'package:core/core.dart'; | |
import 'package:api_sdk/types/reflector.dart'; | |
import 'package:api_sdk/framework/auth-provider.dart'; | |
import 'package:api_sdk/framework/data-provider.dart'; | |
import 'package:api_sdk/framework/api-route.dart'; | |
import 'package:api_sdk/framework/api-method.dart'; | |
import 'package:api_sdk/framework/api-service.dart'; | |
import 'package:core/models/user.dart'; | |
abstract class PostQuery { |
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
Japanese | Romaji | Basque | English | |
---|---|---|---|---|
だ | da | da | is | |
鳥 | tori | txori | bird | |
はい | hai | bai | yes | |
以前 | izen | zen | previously | |
ばかり | bakari | bakarrik | only / alone | |
あにさん | ani-san | anaia nagusia | older brother |
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 { WebSocketMessage, WebSocketMessageType } from "../common/ws-message.js" | |
class ClientApp { | |
static body: HTMLBodyElement | |
static wsc: WebSocket | |
static ws_send(msg: WebSocketMessage) { | |
if (!ClientApp.wsc) return |
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
export enum WebSocketMessageType { | |
PING = 'ping', | |
ECHO = 'echo' | |
} | |
export class WebSocketMessage { | |
public msg_type: WebSocketMessageType | |
public data: Object |
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 { WebSocketMessage, WebSocketMessageType } from "../../common/ws-message.js" | |
export class WebSocketAPI { | |
private static command_table: {[name:string]: Function} = { | |
'ping': WebSocketAPI.ping, | |
'echo': WebSocketAPI.echo | |
} | |
public static handle(message: WebSocketMessage): Promise<WebSocketMessage> { |
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
export enum WebSocketOpcode { | |
CONTINUE = 0x0, | |
TEXT = 0x1, | |
BINARY = 0x2, | |
CLOSE = 0x8 | |
} | |
export abstract class WebSocketFrame { |
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 * as crypto from 'node:crypto' | |
import { IncomingMessage } from 'node:http' | |
import { Duplex } from "node:stream"; | |
import { AppConfig } from '../app-config.js' | |
import { WebSocketOpcode, WebSocketFrame } from './ws-frame.js'; | |
import { WebSocketMessage } from '../../common/ws-message.js'; | |
import { WebSocketAPI } from './ws-api.js'; | |
export class WebSocketRouter { |
NewerOlder