Someone was asking me about comparing the HoC and Render Props patterns (and their shortcomings) to hooks. I might leave this up as a public gist for others if it's helpful.
tldr;
Issues with HoC:
MRuby::Build.new do |conf| | |
# load specific toolchain settings | |
conf.toolchain :visualcpp | |
# Use mrbgems | |
# conf.gem 'examples/mrbgems/ruby_extension_example' | |
# conf.gem 'examples/mrbgems/c_extension_example' do |g| | |
# g.cc.flags << '-g' # append cflags in this gem | |
# end | |
# conf.gem 'examples/mrbgems/c_and_ruby_extension_example' |
# create a local .env file with the following 4 properties: | |
# | |
# MYSQL_DATABASE=<something> | |
# MYSQL_USER=<something> | |
# MYSQL_PASSWORD=<something> | |
# MYSQL_ROOT_PASSWORD=<something> | |
# | |
# Note: I have had a LOT of issues working with anything newer then Docker Desktop v4.26.1 | |
# If you're on something newer, then double check against this release. | |
# |
Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt
If you use the referal link below, you get $10 free (1 or 2 months) https://m.do.co/c/5424d440c63a
I will be using the root user, but would suggest creating a new user
import logo from './logo.svg'; | |
import './App.css'; | |
import { useState } from 'react'; | |
function App() { | |
const [reverse, setReverse] = useState(false); | |
const [counter, setCounter] = useState(0); | |
const reverseClass = reverse ? 'reverse' : ''; | |
const handleClick = () => { |
import './App.css'; | |
import { useState, useEffect } from 'react'; | |
const eventFn = () => { | |
console.log('h1 clicado'); | |
}; | |
function App() { | |
const [counter, setCounter] = useState(0); | |
const [counter2, setCounter2] = useState(0); |
import P from 'prop-types'; | |
import { useEffect, useMemo, useState } from 'react'; | |
import './App.css'; | |
const Post = ({ post }) => { | |
console.log('Filho renderizou'); | |
return ( | |
<div key={post.id} className="post"> | |
<h1>{post.title}</h1> | |
<p>{post.body}</p> |
import P from 'prop-types'; | |
import { useEffect, useMemo, useState, useRef } from 'react'; | |
import './App.css'; | |
const Post = ({ post, handleClick }) => { | |
console.log('Filho renderizou'); | |
return ( | |
<div key={post.id} className="post"> | |
<h1 style={{ fontSize: '14px' }} onClick={() => handleClick(post.title)}> | |
{post.title} |
import { useReducer } from 'react'; | |
import './App.css'; | |
const globalState = { | |
title: 'O título que contexto', | |
body: 'O body do contexto', | |
counter: 0, | |
}; | |
const reducer = (state, action) => { |
#!/usr/bin/env bash | |
# | |
# Reads AirTag data from the FindMy.app cache and converts it to a daily GPX file | |
# | |
# Rsyncs the data to a web accessible folder that can be displayed with e.g. | |
# https://gist.github.com/henrik242/84ad80dd2170385fe819df1d40224cc4 | |
# | |
# This should typically be run as a cron job | |
# |