This file contains hidden or 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
search_dockerhub() { | |
curl -s "https://hub.docker.com/api/content/v1/products/search?source=community&q=$1&page=1&page_size=10" | jq -r '.summaries[]["name"]' | |
} |
This file contains hidden or 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
yarn add -D prettier | |
cat > ./.prettierrc <<EOL | |
{ | |
"printWidth": 70, | |
"singleQuote": true, | |
"trailingComma": "es5" | |
} | |
EOL | |
npx add-project-script -n "lint" -v "prettier --check './src/**/*.{tsx,ts,js,json}'" | |
npx add-project-script -n "lint:fix" -v "prettier --write './src/**/*.{tsx,ts,js,json}'" |
This file contains hidden or 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
apiVersion: extensions/v1beta1 | |
kind: Deployment | |
metadata: | |
creationTimestamp: null | |
labels: | |
run: my-webapp-deployment | |
name: my-webapp-deployment | |
spec: | |
replicas: 1 | |
selector: |
This file contains hidden or 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
.gitignore | |
.dockerignore | |
README.md | |
Dockerfile | |
./build | |
./node_modules | |
./coverage | |
./**/*.js.snap |
This file contains hidden or 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
# Stage 1 - prepare application dependencies and bundle it | |
FROM node:dubnium as build-assets | |
WORKDIR /usr/src/app | |
COPY package.json package-lock.json ./ | |
RUN npm ci | |
COPY . ./ | |
RUN npm run build | |
# Stage 2 - serve only build assets through a static server | |
FROM node:dubnium |
This file contains hidden or 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 fetch from "node-fetch"; | |
interface Location { | |
place_id: number; | |
licence: string; | |
osm_type: string; | |
osm_id: number; | |
boundingbox: string[]; | |
lat: string; | |
lon: string; |
This file contains hidden or 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
const NodeGeocoder = require('node-geocoder'); | |
const { geocode } = NodeGeocoder({ | |
provider: 'google', | |
apiKey: 'YOUR_API_KEY', | |
}); | |
(async () => { | |
const location = await geocode('29 champs elysée paris'); | |
This file contains hidden or 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
sudo /usr/lib/NetworkManager/nm-l2tp-service --debug |
This file contains hidden or 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 mono:latest | |
RUN apt-get update | |
RUN apt-get install -y apt-transport-https | |
RUN curl -sL https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.asc.gpg | |
RUN mv microsoft.asc.gpg /etc/apt/trusted.gpg.d/ | |
RUN curl -slO https://packages.microsoft.com/config/debian/8/prod.list | |
RUN mv prod.list /etc/apt/sources.list.d/microsoft-prod.list | |
RUN chown root:root /etc/apt/trusted.gpg.d/microsoft.asc.gpg | |
RUN chown root:root /etc/apt/sources.list.d/microsoft-prod.list |