Skip to content

Instantly share code, notes, and snippets.

@krisfoster
krisfoster / clean-code.sh
Last active May 16, 2024 09:14
clean-code.sh
#!/usr/bin/env bash
# flags
INSTALL_DIR=""
TMP_EXT_DIR=""
TMP_USR_DIR=""
#
INSTALL_FROM_DIR=false
INSTALL_JAVA=false
@krisfoster
krisfoster / graalvm-install.sh
Created November 16, 2021 13:58
Script to install graalvm etc on a dev box (OL8)
#!/usr/bin/env bash
sudo yum upgrade -y
sudo yum update -y oraclelinux-release-el8
sudo yum config-manager --set-enabled ol8_codeready_builder
sudo yum install -y graalvm21-ee-11-native-image
sudo yum install -y graalvm21-ee-17-native-image
sudo yum install -y tmux zsh gdb maven git curl emacs
#curl -L https://git.io/epre | sh
mkdir -p ~/bin
cd ~/bin
@krisfoster
krisfoster / Setting up Native Image on Windows
Last active September 13, 2021 14:18
Setting up Native Image on Windows
Scott's Instructions
===================================================
https://swseighman.github.io/Native-Image-Windows-10/
https://github.com/swseighman/Native-Image-Windows-10
Install:
* choco
* install windows-sdk-10
* kb2919442
* VS Build Tools
package org.example.web.graal;
import org.apache.tomcat.util.descriptor.web.ServletDef;
import org.apache.tomcat.util.descriptor.web.WebXml;
import org.apache.tomcat.util.descriptor.web.WebXmlParser;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.web.servlet.ServletContextInitializer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.io.Resource;
package org.example.graal.features;
import com.oracle.svm.core.SubstrateUtil;
import com.oracle.svm.core.annotate.*;
import com.oracle.svm.hosted.FeatureImpl;
import com.oracle.svm.hosted.config.ReflectionRegistryAdapter;
import org.graalvm.nativeimage.ImageSingletons;
import org.graalvm.nativeimage.hosted.Feature;
import org.graalvm.nativeimage.hosted.RuntimeReflection;
import org.graalvm.nativeimage.impl.ReflectionRegistry;
@krisfoster
krisfoster / github.css
Last active December 8, 2020 16:23 — forked from tuzz/github.css
Github Markdown Stylesheet
/*
Copyright (c) 2017 Chris Patuzzo
https://twitter.com/chrispatuzzo
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@krisfoster
krisfoster / GraalVM-EE-Setup.md
Last active March 4, 2020 13:46
GraalVM EE 20.0.0 Version Setup Instructions

GraalVM Setup Guide

Getting Setup

Installing GraalVM

The full instructions on getting setup, can be found here, Installing .

A quick summary of this is:

@krisfoster
krisfoster / ClearAssignments.xml
Created May 10, 2016 08:42
CustomElements/OpenMarket/Xcelerate/Admin/Monitor/ClearAssignments.xml
<?xml version="1.0" ?>
<!DOCTYPE FTCS SYSTEM "futuretense_cs.dtd">
<FTCS Version="1.1">
<!--
$Logfile: /VerticalApps/XcelerateC/install/Xcelerate/Populate/ElementCatalog/OpenMarket/Xcelerate/Admin/Monitor/ClearAssignments.xml $
$Revision: 27 $
$Modtime: 2/27/04 2:46p $
-->
@krisfoster
krisfoster / assetapi.java
Created May 2, 2016 11:02
Asset API Update code
private final void migrateAsset(final Long imageID, Set<String> cats)
throws AssetNotExistException, AssetAccessException {
// Used to indicate whether or not we needed to udpate the asset
boolean updated = false;
//
Iterable<AssetData> assets = getAssetData(this._adm, "Image_C", imageID);
//
List<AssetData> sAssets = new ArrayList<AssetData>();
for ( AssetData a : assets ) {
//
<AttributeList>
<Attribute>
<Name>CATEGORY INTRO IMAGE</Name>
<Value>Image_C:48aa7a36-7a72-4457-9e19-80663775045a</Value>
</Attribute>
<Attribute>
<Name>CATEGORY_IMAGE_CI</Name>
<Value>/retail/iows/zz/en/content/Image_C:48aa7a36-7a72-4457-9e19-80663775045a</Value>
</Attribute>