Skip to content

Instantly share code, notes, and snippets.

@Lightnet
Lightnet / README.md
Last active October 2, 2022 17:45
SurrealDB test file. server nodejs

SurrealDB Nodejs.

surrealDB:

  • 1.0.0 beta 8
    • change to 'Content-Type': 'application/json' > 'Accept': 'application/json'
    • text to json response for better error handle checks

Test build for server in case of the browser client does work correct for testing. As long there headers and json or text for correct format for sql, sign in and sign up.

This is mixed with websocket(not added) and http request rest api to SurrealDB connection or request http for testing.

@Lightnet
Lightnet / README.md
Last active August 29, 2022 17:10
vite solid gun js

Manage to get some what working. Required some set up in proxy, plugin and config.

@Lightnet
Lightnet / README.md
Created August 26, 2022 01:03
Solid-js gunjs simple ui, account and tests for buildless

By using the solid-js and gun to help improve and keep it simple.

For reason to choose solid-js is that render once. It does not render all by render when it needed. It did say docs some where.

As well to learn some basic using buildless without compiler.

Like react, preact and vuejs it would render all variables chanage.

https://www.solidjs.com/

@Lightnet
Lightnet / server.js
Created July 28, 2022 02:42 — forked from Jxck/server.js
WebSocket Server Sample Impliment
// Reference
// http://tools.ietf.org/html/rfc6455
// http://www.w3.org/TR/2011/WD-websockets-20110929/
// https://github.com/einaros/ws
// https://github.com/Worlize/WebSocket-Node
// http://ja.wikipedia.org/wiki/WebSocket
// http://www.slideshare.net/You_Kinjoh/javascript-websocket P.68
// http://d.hatena.ne.jp/gtk2k/20120203/1328274962
var log = console.log.bind(console);
@Lightnet
Lightnet / README.md
Last active July 18, 2022 17:10
bun js http server cookie simple
@Lightnet
Lightnet / denooak.ts
Created July 6, 2022 03:15
Testing the Deno and Oak config type for detail testing.
import {
Application,
Router
} from "https://deno.land/x/oak/mod.ts";
const port = 8000;
const app = new Application({
logErrors: false
});
@Lightnet
Lightnet / README.md
Last active March 28, 2022 18:36
Vue 3 express

Just simple paste files how simple vue 3 setup on server side.

Notes:

<script type="importmap">
  {
    "imports": {
      "vue": "https://unpkg.com/vue@3/dist/vue.esm-browser.js"
    }
 }
@Lightnet
Lightnet / GunKeys.mjs
Created March 26, 2022 20:21
vue 3.x gun plugin
export const GunInjectKey = Symbol();
@Lightnet
Lightnet / README.md
Last active March 24, 2022 22:18
Vue 3 Event Bus Plugin
@Lightnet
Lightnet / EntityTransformControl.vue
Last active March 23, 2022 22:25
Vuejs TransformControls troisjs
<script setup>
/*
LICENSE: MIT
Created by: Lightnet
*/
// https://sbcode.net/threejs/transform-controls/
// https://github.com/mrdoob/three.js/blob/master/examples/misc_controls_transform.html
// https://threejs.org/examples/#misc_controls_transform
import { TransformControls } from 'three/examples/jsm/controls/TransformControls';