- Navigate to directus install folder
npm install directus@10
npx directus database migrate:latest
pm2 stop directus
pm2 start directus
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
// add a onclick event listener to an img tag and call the function nextImage with comma separated image sources | |
function nextImage(imageSources) { | |
var images = imageSources.split(", "); | |
const myImg = document.getElementById("detailImage"); | |
var i = myImg.dataset.currentImage || 0; | |
if(i<images.length-1){ | |
i++; | |
}else{ |
- Ubuntu 22.04 LTS
- PostgreSQL
- Caddy Proxy
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
package de.samuelstein.project.configuration; | |
import lombok.Getter; | |
import lombok.Setter; | |
import lombok.ToString; | |
import org.apache.hc.client5.http.impl.classic.HttpClientBuilder; | |
import org.springframework.boot.context.properties.ConfigurationProperties; | |
import org.springframework.context.annotation.Bean; | |
import org.springframework.context.annotation.Primary; | |
import org.springframework.http.client.HttpComponentsClientHttpRequestFactory; |
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
.docker_build_database: | |
extends: .docker_base | |
variables: | |
PGPASSWORD: postgres | |
POSTGRES_IMAGE: "${CI_REGISTRY}/${CI_PROJECT_PATH}/postgres:latest" | |
SPECIFIC_IMAGE_NAME: database | |
DOCKER_TAG: latest | |
before_script: &docker_build_database_before_script | |
- export DOCKER_IMAGE="${CI_REGISTRY}/${CI_PROJECT_PATH}/${SPECIFIC_IMAGE_NAME}" | |
- *docker_base_before_script |
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
public ResponseEntity<String> doJsonRequest(HttpMethod httpMethod, String path, Object body) throws URISyntaxException { | |
RestTemplate restTemplate = new RestTemplate(new HttpComponentsClientHttpRequestFactory()); | |
HttpHeaders headers = new HttpHeaders(); | |
headers.setContentType(MediaType.APPLICATION_JSON); | |
headers.add(COOKIE, getWebdriver().manage().getCookieNamed(YOUR_APP_COOKIE_NAME).toString()); | |
headers.setAccept(List.of(MediaType.APPLICATION_JSON, MediaType.TEXT_HTML)); | |
var request = new HttpEntity<>(body, headers); | |
return restTemplate.exchange(new URI("http", null, hostIpAddress, port, path, null, null), httpMethod, request, String.class); |
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
Type listType = new TypeToken<ArrayList<YourClass>>(){}.getType(); | |
List<YourClass> yourClassList = new Gson().fromJson(jsonArray, listType); |
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 model.IFileWatchListener; | |
import org.apache.logging.log4j.LogManager; | |
import org.apache.logging.log4j.Logger; | |
import java.io.IOException; | |
import java.nio.file.*; | |
import java.util.ArrayList; | |
import java.util.List; | |
public class FileWatcher extends Thread { |
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
/** | |
* This is a wrapper class that registers the font awesome .ttf included in the package. | |
* ControlsFX loads this font dynamically at run time from a CDN. Thus, it works only if Internet | |
* connection is available | |
* . | |
* This class registers an included version of the font. The {@link #init()} method should be called | |
* during the initialization procedure of the application such that the font is available early. | |
* | |
* @author albrecht | |
*/ |
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 hudson.model.ListView | |
import jenkins.model.* | |
//Parameters: In case you are running this outside Scriptler, please uncomment and fill the following line. | |
view_name = "ViewName"; | |
vc = Jenkins.instance.getView(view_name).getOwner(); | |
v = vc.getView(view_name); | |
//delete jobs belonging to the view |
NewerOlder