Skip to content

Instantly share code, notes, and snippets.

View mjsarfatti's full-sized avatar
💭
is probably sleeping

Manuele J Sarfatti mjsarfatti

💭
is probably sleeping
View GitHub Profile
@mjsarfatti
mjsarfatti / README.md
Created January 16, 2021 22:36
OG Image generator for Gatsby

0. Install packages

npm install --save-dev @babel/register @babel/plugin-proposal-class-properties

  • or -

yarn add --dev @babel/register @babel/plugin-proposal-class-properties

0.bis Also install

@mjsarfatti
mjsarfatti / withSyncChange.js
Created January 5, 2019 16:24
Async setState in React (and especially often when used w/ state management libs like 'unstated') can cause the caret in a form to jump
import React, { Component } from 'react';
export default function withSyncChange(WrappedComponent) {
return class extends Component {
constructor(props) {
super(props);
this.state = {
value: props.value, // initial value
parentValue: props.value, // tracking the parent value
};
# Initial setup
git clone -o laravel -b master https://github.com/laravel/laravel.git project-name
cd project-name
git checkout --orphan master
git commit -m "Initial commit"
composer install
# --or, simply--
composer create-project laravel/laravel
# Pulling changes