with PM2 & Nginx
as a root, run below commands on server:
# adduser tomy
from xml.etree.ElementTree import ElementTree | |
import os | |
def ProcessGHXFile(definition_path, base_filename): | |
# Loads the file and sets up the XML parser | |
the_file = open(definition_path) | |
the_directory = os.path.dirname(definition_path) | |
the_tree = ElementTree() | |
the_tree.parse(the_file) | |
IsolateTheScript(the_tree, the_directory, base_filename) |
/** | |
* 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 |
// 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 |
# 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 |
// 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. |
--- | |
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_]*$' |
alias gityolo='git commit -am "DEAL WITH IT" && git push -f origin master' |