Skip to content

Instantly share code, notes, and snippets.

View dietrichmax's full-sized avatar

Max Dietrich dietrichmax

View GitHub Profile
@dietrichmax
dietrichmax / gist:845737a8de8b186aa27a699760eba691
Last active September 29, 2022 19:48
Nginx Configuration for Nextjs
server {
# Listen HTTP
listen 443 ssl;
listen [::]:443 ssl;
server_name domain.com;
gzip on;
gzip_proxied any;
gzip_comp_level 4;
import React, { useState, useEffect, useRef } from 'react';
import { Feature, Map, View } from 'ol';
import TileLayer from 'ol/layer/Tile';
import Overlay from 'ol/Overlay';
import OSM from 'ol/source/OSM';
import {fromLonLat} from 'ol/proj';
import 'ol/ol.css';
import VectorLayer from 'ol/layer/Vector';
import VectorSource from 'ol/source/Vector';
@dietrichmax
dietrichmax / gist:f14547acd4eb9c21280cf87c09783844
Created January 17, 2024 19:11
Dockerize existing Strapi v3
FROM node:14 AS base
# Install dependencies only when needed
FROM base AS deps
WORKDIR /app
# Install dependencies based on the preferred package manager
COPY package.json yarn.lock* package-lock.json* pnpm-lock.yaml* ./
RUN npm install
const axios = require('axios');
const { GarminConnect } = require('garmin-connect');
const GCClient = new GarminConnect();
const getExistingActivities = async () => {
const existingActivityIds = []
const activities = await axios.get(`${process.env.HOST}/activities`)
activities.data.map((activity) => {
existingActivityIds.push(activity.activityId)