Skip to content

Instantly share code, notes, and snippets.

View carloshs92's full-sized avatar
🎯
Focusing

Carlos carloshs92

🎯
Focusing
View GitHub Profile
@carloshs92
carloshs92 / index.css
Last active September 13, 2018 16:01
Detect the number of children an element has with CSS
/* one item */
li:first-child:nth-last-child(1) {
/* -or- li:only-child { */
width: 100%;
}
/* two items */
li:first-child:nth-last-child(2),
li:first-child:nth-last-child(2) ~ li {
width: 50%;
@carloshs92
carloshs92 / SimpleWebRTC.tsx
Created June 6, 2019 19:54
SimpleWebRTC code example
<Provider store={store}>
<SWRTC.Provider configUrl={CONFIG_URL} userData={userDataToken} >
<SWRTC.Connecting configUrl={CONFIG_URL}>
<Loader size={40} style={{padding: '40px 0'}}/>
</SWRTC.Connecting>
<SWRTC.Connected configUrl={CONFIG_URL} userData={userDataToken}>
{/* Request the user's media */}
<SWRTC.RequestUserMedia audio={true} video={true} auto={true}/>