Skip to content

Instantly share code, notes, and snippets.

View Eventyret's full-sized avatar
🚒
Strapi Solutions Engineer

Simen Daehlin Eventyret

🚒
Strapi Solutions Engineer
View GitHub Profile
@Eventyret
Eventyret / setup.sh
Created October 8, 2023 07:48
Easy Panels Server Setup
#!/bin/bash
function update_packages() {
echo -e "\n📦 Updating packages... 📦\n"
apt-get update -y
apt-get upgrade -y
apt-get autoremove -y
apt-get autoclean -y
}
@Eventyret
Eventyret / transferdata.js
Created August 30, 2023 07:43
Transfer data from two API's
const fetch = require('node-fetch');
const fs = require('fs');
const path = require('path');
const readline = require('readline');
const ghostEndpoint = 'https://ghostcms.com/content/posts/';
const strapiEndpoint = 'https://strapiinstance.com/api/blogs';
async function fetchData() {
try {
@Eventyret
Eventyret / setup.sh
Created August 22, 2023 20:47
Dokku Setup
#!/bin/bash
function update_packages() {
echo -e "\n📦 Updating packages... 📦\n"
apt-get update -y
apt-get upgrade -y
apt-get dist-upgrade -y
apt-get autoremove -y
apt-get autoclean -y
}
@Eventyret
Eventyret / lifecycle.js
Created March 29, 2023 11:38
Validation Lifcylehook
const utils = require("@strapi/utils");
const { ApplicationError } = utils.errors;
const isDisconnecting = (disconnectArray, entityValue) => {
return disconnectArray.length && entityValue !== null;
};
module.exports = {
async beforeUpdate(event) {
const { data, where } = event.params;
version: '3.9'
services:
# Strapi Dev Enviroment
strapidev:
container_name: strapi_dev
build:
context: .
dockerfile: Dockerfile
args:
NODE_ENV: ${NODE_ENV}
@Eventyret
Eventyret / resources.md
Created February 12, 2019 10:37
Student Resources

Resources that are helpful