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
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
# 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
.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
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
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
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
-- You can use either 'error', 'failure' or 'success' as a status on each of these. | |
UPDATE stages SET stage_status = 'success' WHERE stage_id = $stage_id; | |
UPDATE builds SET build_status = 'success' WHERE build_id = $build_id; | |
UPDATE steps SET step_status = 'success' WHERE step_id = $step_id; | |
-- This timestamp must be bigger than the step_started field of the steps table. | |
UPDATE steps SET step_stopped = 1583330000 WHERE step_id = $step_id; |
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
# open terminal | |
cmd - return : open -n -a "Terminal" | |
# open chrome | |
cmd + shift - return : open -n -a "Google Chrome" | |
# moves focus between windows in the current focused display | |
alt - h : yabai -m window --focus west | |
alt - j : yabai -m window --focus south | |
alt - k : yabai -m window --focus north |