Skip to content

Instantly share code, notes, and snippets.

@MarceloRab
MarceloRab / socket _ts _example.ts
Created November 14, 2024 14:01
socket ts example
import SocketIO from "socket.io";
import io from "socket.io-client";
class Socket {
//public socketClient = io("http://localhost:8000");
//public socketClient2 = io("http:<ip:8000>");
public socketClient = io("wss:/<end-point-render>");
public connectClientSocket(): void {
this.socketClient.on("connect", () => {
@MarceloRab
MarceloRab / socker_fluter.dart
Created November 14, 2024 13:58
Socket + Flutter example
// Flutte side
import 'package:flutter/material.dart';
//ignore: library_prefixes
import 'package:socket_io_client/socket_io_client.dart' as IO;
const apiSocketUrl = 'wss://<render-end-point>.com';
const apiSocketUrl = 'http://localhost:8000';
//👉🏼 obs: Android and Localhost worked perfectly.
@MarceloRab
MarceloRab / .js
Last active February 7, 2024 16:07
Validar Celular para contato WhatsApp
const numberCel = '554791517799';
function addNine(number) {
if (numberCel.slice(0, -numberCel.length + 2) !== '55') {
//if (numberCel[0] + numberCel[1] !== '55') {
// numberCel.slice(0,-numberCel.length +2)
return number;
}
if (
numberCel[4] === '2' ||
void main() {
print('No Adulto: \n' + ModelPosologia.posologiaAdulto(DIPIRONA));
print('------------');
print('Em Pediatria: \n' + posologiaPed(DIPIRONA));
}
/*
No Adulto:
• 01 cp de 6/6hs
------------