Skip to content

Instantly share code, notes, and snippets.

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

João Carvalho joaocarvalhowd

🏠
Working from home
View GitHub Profile
{"data":{"type":"Buffer","data":[31,139,8,0,0,0,0,0,0,19,236,189,91,111,34,91,150,239,251,85,66,150,90,234,173,237,21,57,175,113,241,86,63,4,16,64,64,92,32,8,130,203,217,165,22,203,38,115,177,202,54,46,108,175,94,149,189,215,211,121,58,15,251,67,180,250,161,85,71,170,167,210,126,57,175,249,197,142,2,156,105,12,1,17,16,24,207,9,99,169,164,204,202,132,72,204,156,99,140,255,252,205,113,249,247,139,135,209,245,159,71,95,198,214,111,163,201,237,227,197,213,255,245,239,23,191,76,159,198,183,75,255,255,97,54,253,109,114,51,158,93,92,93,4,158,239,148,108,187,163,56,126,116,113,121,113,253,203,248,250,207,206,253,197,213,5,65,132,253,132,244,159,8,253,254,199,193,243,211,242,159,27,23,151,139,7,95,92,253,251,197,228,230,226,138,50,141,224,203,139,63,143,255,90,25,63,141,38,183,23,87,23,222,215,54,241,126,181,127,13,34,239,223,252,191,122,191,251,191,122,191,7,237,127,249,151,139,203,139,251,209,221,248,226,234,162,158,60,65,233,62,40,214,221,183,191,205,38,215,35,165,117,59,250,58,186,184,188,24,221,220,204,198,143,14
resources:
- argocd.yaml
const {
all,
is,
isEmpty,
isNil,
or,
toPairs
} = require('ramda')
const isNilOrEmpty = value => or(isNil(value), isEmpty(value))
@joaocarvalhowd
joaocarvalhowd / app.js
Created April 9, 2019 13:40
More easily
import React, { useRef } from "react";
import {
AppBar, Typography, Toolbar, TextField
} from "@material-ui/core";
function App() {
const fields = {
name: useRef(),
github: useRef(),
linkedin: useRef(),
@joaocarvalhowd
joaocarvalhowd / app.js
Created April 9, 2019 13:35
Get value
import React, { useRef } from "react";
import {
AppBar, Typography, Toolbar, TextField
} from "@material-ui/core";
function App() {
const fields = {
name: useRef(),
github: useRef(),
linkedin: useRef(),
@joaocarvalhowd
joaocarvalhowd / app.js
Last active April 9, 2019 13:27
React - example form with useRef
import React, { useRef } from "react";
import {
AppBar, Typography, Toolbar, TextField
} from "@material-ui/core";
function App() {
const fields = {
name: useRef(),
github: useRef(),
linkedin: useRef(),
@joaocarvalhowd
joaocarvalhowd / app.js
Created April 9, 2019 13:16
React - example form with state
import React, { useReducer } from "react";
import {
AppBar, Typography, Toolbar, TextField
} from "@material-ui/core";
function App() {
const [fields, setFields] = useReducer(
(state, newState) => ({ state, ...newState }),
{ name: '', github: '', linkedin: '', website: '' }
);
@joaocarvalhowd
joaocarvalhowd / macos-recovery-server.md
Created June 20, 2018 22:07
Fixing "The recovery server could not be contacted" in MacOS High Sierra

I was trying to reinstall High Sierra on an older MacBook Air using internet recovery and I kept on getting an error message when trying to reinstall High Sierra.

The recovery server could not be contacted

It appears that this has to do with the time on the machine not being synchronized, so when the MacBook tries to reach out to the recovery server the certificates do not validate and we get this useless error message.

To fix this.

  1. Open up a Terminal from the utilities menu
  2. Enter the following command
module.exports = {
debug: true,
build: {
extend (config) {
config.externals = {
newrelic: true
}
const vueLoader = config.module.rules.find((module) => {
return module.test.toString() === '/\\.vue$/'
@joaocarvalhowd
joaocarvalhowd / README.md
Created March 15, 2018 15:09 — forked from rayfranco/README.md
Inline SVG with Nuxt

Inline SVG with Nuxt

I was looking for a SSR and scoped styles ready solution to implement inline SVG with Nuxt

You need svg-inline-loader and xmldom to be installed.