Skip to content

Instantly share code, notes, and snippets.

View imaginamundo's full-sized avatar

Diogo Fernandes imaginamundo

View GitHub Profile
@czottmann
czottmann / . ̸island ̸StoreUsingComponent1.tsx
Last active December 15, 2023 20:41
Deno + Statery example
/** @jsx h */
import { h } from "preact";
import { incrementCount, state } from "../stores/whatever_store.ts";
export default function StoreUsingComponent1() {
const { counter } = state();
return (
<p>
<button onClick={incrementCount}>
@alexpchin
alexpchin / socket-cheatsheet.js
Created December 15, 2015 16:58
A quick cheatsheet for socket.io
// sending to sender-client only
socket.emit('message', "this is a test");
// sending to all clients, include sender
io.emit('message', "this is a test");
// sending to all clients except sender
socket.broadcast.emit('message', "this is a test");
// sending to all clients in 'game' room(channel) except sender