Install, build and debug a react native app in WSL2 (Windows Subsystem for Linux) and Ubuntu.
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
# First, remove all the folders in the npx cache location | |
# https://github.com/npm/cli/issues/1935#issuecomment-745561262 | |
rm -rf $(npm get cache)/_npx/* |
UPDATE (March 2020, thanks @ic): I don't know the exact AMI version but yum install docker
now works on the latest Amazon Linux 2. The instructions below may still be relevant depending on the vintage AMI you are using.
Amazon changed the install in Linux 2. One no-longer using 'yum' See: https://aws.amazon.com/amazon-linux-2/release-notes/
sudo amazon-linux-extras install docker
sudo service docker start
How to:
- create a Docker-based AWS Fargate/ECS deployment
- without the Docker containers having a public IP
- with an Application Load Balancer as reverse proxy / SSL termination proxy sitting in front of the containers
For Fargate/ECS to be able to access your Docker images hosted on ECR (or somewhere else) you'll have to allow outbound internet access to the Fargate subnets. Here's how you do it.
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
import http = require('http') | |
import https = require('https') | |
import url = require('url') | |
import {AxiosInstance, AxiosInterceptorManager} from 'axios' | |
import {HttpRequestOptions as HttpFollowRequestOptions, http as httpFollow, https as httpsFollow} from 'follow-redirects' | |
import now = require('performance-now') | |
import httpAdapter = require('axios/lib/adapters/http') | |
import InterceptorManager = require('axios/lib/core/InterceptorManager') |
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
CREATE EXTENSION IF NOT EXISTS "unaccent"; | |
CREATE OR REPLACE FUNCTION slugify("value" TEXT) | |
RETURNS TEXT AS $$ | |
-- removes accents (diacritic signs) from a given string -- | |
WITH "unaccented" AS ( | |
SELECT unaccent("value") AS "value" | |
), | |
-- lowercases the string | |
"lowercase" AS ( |
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
### NOT A SCRIPT, JUST A REFERENCE! | |
# install dante-server | |
sudo apt update | |
sudo apt install dante-server | |
# or download latest dante-server deb for Ubuntu, works for 16.04 / 18.04 / 20.04: | |
wget http://archive.ubuntu.com/ubuntu/pool/universe/d/dante/dante-server_1.4.2+dfsg-7build5_amd64.deb | |
# or older version: | |
wget http://ppa.launchpad.net/dajhorn/dante/ubuntu/pool/main/d/dante/dante-server_1.4.1-1_amd64.deb |
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
export default class Location extends Component { | |
constructor(props) { | |
super(props); | |
this._locationReceived = false; | |
this._locationWatchID = null; | |
}; | |
componentDidMount() { |
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
FROM alpine | |
RUN apk add --update --no-cache nodejs | |
RUN npm i -g yarn | |
ADD package.json yarn.lock /tmp/ | |
ADD .yarn-cache.tgz / | |
RUN cd /tmp && yarn | |
RUN mkdir -p /service && cd /service && ln -s /tmp/node_modules |
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
machine: | |
pre: | |
- mkdir ~/.yarn-cache | |
node: | |
version: stable | |
dependencies: | |
pre: | |
- curl -o- -L https://yarnpkg.com/install.sh | bash | |
cache_directories: | |
- ~/.yarn-cache |
NewerOlder