Skip to content

Instantly share code, notes, and snippets.

@rodja
rodja / chat_app.py
Created May 8, 2023 03:36
Coding a Multi-User Chat App With NiceGUI
from uuid import uuid4
from nicegui import ui
messages = []
@ui.refreshable
def chat_messages(own_id):
for user_id, avatar, text in messages:
ui.chat_message(avatar=avatar, text=text, sent=user_id==own_id)
@rodja
rodja / linccer-javascript-example.js
Created January 25, 2011 15:32
Linccer Javascript Example
var linncer = Linccer({"api_key": "your_api_key", "server": "sandbox" });
window.onload = function() {
if (!Linccer.autoLocate()) {
linccer.setEnvironmentCoordinates(longitude, latitude, accuracy);
}
linccer.on('received', function(data) {
// do somthing with the received data