Skip to content

Instantly share code, notes, and snippets.

View xiCO2k's full-sized avatar
πŸš’
I'm the web plumber!

Francisco Madeira xiCO2k

πŸš’
I'm the web plumber!
View GitHub Profile
@xiCO2k
xiCO2k / useWebSockets.tsx
Created April 13, 2022 17:41 — forked from jonasgroendahl/useWebSockets.tsx
useWebSockets()
import {useEffect, useRef, useState} from 'react';
import io from 'socket.io-client';
type Props = {
userId: number;
enabled: boolean;
onConnected?: () => void;
};
type Message = {
@xiCO2k
xiCO2k / CSS: IR
Created October 4, 2012 15:07 — forked from attegists/CSS: IR
CSS: IR
.ir {
border:0;
font: 0/0 a;
text-shadow: none;
color: transparent;
background-color: transparent;
}
@xiCO2k
xiCO2k / gist:3834170
Created October 4, 2012 15:02 — forked from padolsey/gist:527683
JavaScript: Return ie value
// ----------------------------------------------------------
// A short snippet for detecting versions of IE in JavaScript
// without resorting to user-agent sniffing
// ----------------------------------------------------------
// If you're not in IE (or IE version is less than 5) then:
// ie === undefined
// If you're in IE (>=5) then you can determine which version:
// ie === 7; // IE7
// Thus, to detect IE:
// if (ie) {}