If you plan to use iconv()
to transliterate string in you PHP project, please, take this:
FROM alpine:3.4
RUN apk add --update php5-cli wget build-base php5-dev autoconf re2c libtool \
# | |
# Wide-open CORS config for nginx | |
# | |
location / { | |
if ($request_method = 'OPTIONS') { | |
add_header 'Access-Control-Allow-Origin' '*'; | |
# |
#Ref: https://github.com/circleci/android-cloud-test-lab/blob/master/circle.yml | |
export DIRECTORY="/var/jenkins_home/GoogleCloudSDK/google-cloud-sdk/bin" | |
if [ ! -d "$DIRECTORY" ]; then | |
# Control will enter here if $DIRECTORY doesn't exist. | |
cd /var/jenkins_home | |
wget https://dl.google.com/dl/cloudsdk/release/google-cloud-sdk.zip -O google-cloud-sdk.zip | |
unzip -o google-cloud-sdk.zip -d ./GoogleCloudSDK/ | |
./GoogleCloudSDK/google-cloud-sdk/install.sh | |
systemctl stop docker
/etc/docker/daemon.json
with the following content:{
"storage-driver": "overlay2",
"storage-opts": ["overlay2.override_kernel_check=true"]
}
systemctl start docker
Remix's useFetcher
doesn't return a Promise for any of its methods (like fetcher.submit()
) because Remix doesn't want you to explicitly await
anything so they can handle things like cancellation for you. Instead, they recommend adding a useEffect
and performing whatever logic you need to after the fetcher is in a particular state.
I found using an effect to run some logic after a submission to be too indirect, and there seem to be plenty of cases where you want to submit a form and then perform some other work on the client (sometimes async, like requesting the user's permission for their location), and I'd rather just do that after a submission in the event handler rather than an effect.
So here's a proof of concept hook that wraps Remix's useFetcher
and returns a version of submit
that is a promise, and resolves with the data from the action:
function useFetcherWithPromise() {
let resolveRef = useRef();
let promiseRef = useRef();