Skip to content

Instantly share code, notes, and snippets.

View sualex's full-sized avatar
🏠
Working from home

Alex Gu sualex

🏠
Working from home
View GitHub Profile
@carl0zen
carl0zen / styled-components-mixin-example.jsx
Last active December 8, 2021 05:51
Styled Components Mixin example
// Mixin like functionality
const textInput = props => `
color: ${props.error ? color.white : color.base};
background-color: ${props.error ? color.alert : color.white};
`;
export const Input = styled.input`
${textInput}
`;
@trevordixon
trevordixon / ReconnectingWebSocket.js
Last active April 24, 2021 12:54
ReconnectingWebSocket that exposes its constructor on module.exports.
// MIT License:
//
// Copyright (c) 2010-2012, Joe Walnes
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions: