Skip to content

Instantly share code, notes, and snippets.

View peet's full-sized avatar
🧙
★°٭•゚.*。· ﴾ ⚛ ﴿ °.*•゚。☆

Peet peet

🧙
★°٭•゚.*。· ﴾ ⚛ ﴿ °.*•゚。☆
View GitHub Profile
@acdlite
acdlite / app.js
Last active January 20, 2023 08:23
Quick and dirty code splitting with React Router v4
// getComponent is a function that returns a promise for a component
// It will not be called until the first mount
function asyncComponent(getComponent) {
return class AsyncComponent extends React.Component {
static Component = null;
state = { Component: AsyncComponent.Component };
componentWillMount() {
if (!this.state.Component) {
getComponent().then(Component => {
@LeaVerou
LeaVerou / dabblet.css
Last active September 20, 2023 08:11
Move in a circle without wrapper elements
/**
* Move in a circle without wrapper elements
* Idea by Aryeh Gregor, simplified by Lea Verou
*/
@keyframes rot {
from {
transform: rotate(0deg)
translate(-150px)
rotate(0deg);