This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias gityolo='git commit -am "DEAL WITH IT" && git push -f origin master' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
Description: AWS AppSync Notes API | |
Parameters: | |
APIName: | |
Type: String | |
Description: Name of the API - used to generate unique names for resources | |
MinLength: 3 | |
MaxLength: 20 | |
AllowedPattern: '^[a-zA-Z][a-zA-Z0-9_]*$' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// One of my new favorite React Hook patternms is to create handler | |
// functions for a custom hook using `React.useMemo` instead of | |
// `React.useCallback`, like so: | |
function useBool(initialState = false) { | |
const [state, setState] = React.useState(initialState) | |
// Instead of individual React.useCallbacks gathered into an object | |
// Let's memoize the whole object. Then, we can destructure the | |
// methods we need in our consuming component. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# As root user | |
sudo su | |
# Update the OS | |
sudo apt-get update -y | |
# Add this to ~/.bashrc to remove timezone warnings | |
echo 'export LC_ALL="en_US.UTF-8"' >> ~/.bashrc | |
source ~/.bashrc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This is a proper alternative to | |
// https://github.com/BuckleScript/bucklescript/blob/b9508105b1a35537bdea9a1fabd10f6c65f776b4/jscomp/bsb/templates/react-hooks/src/FetchedDogPictures/FetchedDogPictures.re#L14 | |
// The one in that file uses Promise, but that's *wrong*. | |
// We only used promise as a demo of its API. We'll remove it soon. | |
// As you can see below, the pure XMLHttpRequest code is just as clean, | |
// less mysterious for all, more performant, extensible, and actually correct. | |
// Ignore these externals for now. They're just for illustration | |
// purposes. I just copy pasted the Js code from |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Recipe Tools v0.1 | |
* | |
* This version exists as a GitHub Gist at https://gist.github.com/masyukun/64a3490a464acaa3b9af6819f10dfbf4 | |
* | |
* @license | |
* Copyright (c) 2020 Matthew Royal | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy | |
* of this software and associated documentation files (the "Software"), to deal |